2020年6月30日 星期二

Web RWD APP 代購系統 #3

換寫到後台訂單作業了
有點麻煩,因採用一對多檔模式;在aspnet上的呈現無法像windows app 那樣直覺式,想來想去就是採用2層式來處理:主檔+明細+付款
(未來結構會綁定更多的應用區塊,等有空再貼上來了)


2020年6月28日 星期日

Using GridView's EmptyDataTemplate to insert new row

參考來源:Using GridView's EmptyDataTemplate to insert new row
--
精華段:
Sub ButtonEmptyInsert_Click(ByVal sender As Object, ByVal e As EventArgs)
        ' Insert new record
        Dim RowIndex As Integer = DirectCast(DirectCast(sender, Control).NamingContainer, GridViewRow).RowIndex
        Dim misship_id As DropDownList = TryCast(GridViewDetails.Rows(RowIndex).FindControl("DropListMisShipIDEmpty"), DropDownList)
        Dim code_id As DropDownList = TryCast(GridViewDetails.Rows(RowIndex).FindControl("DropListCodeEmpty"), DropDownList)
        Dim upc As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtUPC"), TextBox)
        Dim description As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtDescription"), TextBox)
        Dim qty_ordered As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtQtyOrdered"), TextBox)
        Dim qty_received As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtQtyReceived"), TextBox)
        Dim cost As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtCost"), TextBox)
        Dim adjust_amount As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtAdjAmt"), TextBox)
        Dim status As DropDownList = TryCast(GridViewDetails.Rows(RowIndex).FindControl("DropListStatusEmpty"), DropDownList)
        Dim status_quantity As TextBox = TryCast(GridViewDetails.Rows(RowIndex).FindControl("txtStatusQty"), TextBox)
        SourceMisShipDetails.InsertParameters("misship_id").DefaultValue = misship_id.SelectedValue
        SourceMisShipDetails.InsertParameters("code_id").DefaultValue = code_id.SelectedValue
        SourceMisShipDetails.InsertParameters("upc").DefaultValue = upc.Text
        SourceMisShipDetails.InsertParameters("description").DefaultValue = description.Text
        SourceMisShipDetails.InsertParameters("qty_ordered").DefaultValue = qty_ordered.Text
        SourceMisShipDetails.InsertParameters("qty_received").DefaultValue = qty_received.Text
        SourceMisShipDetails.InsertParameters("cost").DefaultValue = cost.Text
        SourceMisShipDetails.InsertParameters("adjust_amount").DefaultValue = adjust_amount.Text
        SourceMisShipDetails.InsertParameters("status").DefaultValue = status.SelectedValue
        SourceMisShipDetails.InsertParameters("status_quantity").DefaultValue = status_quantity.Text
        SourceMisShipDetails.Insert()
    End Sub

2020年6月27日 星期六

從RowCommand上的嵌套GridView中的DropDownList中檢索值

從RowCommand上的嵌套GridView中的DropDownList中檢索值
--
底下這段真是精華

// Calls when Inner GridView 's button clicked
protected void GridView_Inner_RowCommand(object sender, GridViewCommandEventArgs e)
{
    // get Inner GridView 's clicked row
    GridViewRow InnerGridViewRow = (GridViewRow)(((Control)e.CommandSource).NamingContainer);

    // get Inner GridView 's controls from clicked row
    TextBox TextBox_Inner = (TextBox)InnerGridViewRow.FindControl("TextBox_Inner");
    DropDownList DropDownList_Inner = (DropDownList)InnerGridViewRow.FindControl("DropDownList_Inner");

    // check if correct button is clicked
    if (e.CommandName == "BtnInnerCmd")
    {
        string DropDownListValue = DropDownList_Inner.SelectedValue;
        string TextBoxValue = TextBox_Inner.Text;

        Label_Result.Text = "DropDownList 's Selected Value is " + DropDownListValue +
                            "
TextBox 's Entered Value is " + TextBoxValue;
    }
}

2020年6月18日 星期四

crystal report 控制字體大小

1.請利用 CrystalReports 公式去判斷字數再去變更其字體大小
2.在欄位上右鍵 --> 格式物件 --> 字型(標籤) --> 大小 ,編輯其公式
3.參考以下公式
if length({@欄位名稱}) > 15 then 9 else 12

2020年5月29日 星期五

Windows 10 SSD 校能調整

最近把SATA HD 改SSD ,發現使用一段時間就變得超級慢
只好來看看怎回事了
改善寫入速度效能,以避免系統凍結
Inetl 這有一篇,調整的方法!!
目前我的調整共2個:
1.關閉 HD 的寫入快取
2.關閉 C: D: 的建立索引
完成後,請關機;再開機!  就有明顯的差異了
---
後續也是要在觀察看看了!
底下為參考圖

 

2020年5月28日 星期四

Web RWD APP 代購系統 #2

會員登入畫面搞定了,再來就是嵌入三竹簡訊API和後端處理機制了
--



2020年5月27日 星期三

Web RWD APP 代購系統 #1

這案子總算定版,確定版型了
客戶在月初急著要,也沒給樣板參考;到底要製作怎樣的樣式
弄得,我只好先初草版;一出~就開始有靈感.....延伸一堆新想法
這樣耗了2週,現這樣式總算是確定了
(接Web RWD APP 真的要心理準備,初版一定被全改的準備.....)
---