Beispiel #1
0
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdInsert":

            break;

        case "cmdEdit":
            fvSiteList.Visible = true;
            divAction.Visible  = false;
            gvSiteList.Visible = !gvSiteList.Visible;

            DetailSiteList siteDetail = new DetailSiteList();
            siteDetail.SiteIDX     = int.Parse(cmdArg);
            dataMaster.SiteList    = new DetailSiteList[1];
            dataMaster.SiteList[0] = siteDetail;
            dataMaster             = serviceMaster.ActionDataMaster("site", dataMaster, 20);
            //litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.SiteList[0]));
            setFormData(fvSiteList, FormViewMode.Edit, dataMaster.SiteList);

            // //read only selected date
            // TextBox tbSiteStartE = (TextBox)fvSiteList.FindControl("tbSiteStartE");
            // TextBox tbSiteEndE = (TextBox)fvSiteList.FindControl("tbSiteEndE");
            // tbSiteStartE.Attributes.Add("readonly", "readonly");
            // tbSiteEndE.Attributes.Add("readonly", "readonly");
            break;

        case "cmdCancel":
            break;
        }
    }
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdInsert":

            break;

        case "cmdEdit":
            fvMaterialList.Visible = true;
            divAction.Visible      = false;
            gvMaterialList.Visible = !gvMaterialList.Visible;

            DetailMaterialList matDetail = new DetailMaterialList();
            matDetail.MIDX             = int.Parse(cmdArg);
            dataMaster.MaterialList    = new DetailMaterialList[1];
            dataMaster.MaterialList[0] = matDetail;
            dataMaster = serviceMaster.ActionDataMaster("materiallist", dataMaster, 20);
            //litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.MaterialList[0]));
            setFormData(fvMaterialList, FormViewMode.Edit, dataMaster.MaterialList);
            DropDownList ddlAsIDXE = (DropDownList)fvMaterialList.FindControl("ddlAsIDXE");
            ddlAsIDXE.SelectedValue = dataMaster.MaterialList[0].AsIDX.ToString();
            DropDownList ddlKIDXE = (DropDownList)fvMaterialList.FindControl("ddlKIDXE");
            ddlKIDXE.SelectedValue = dataMaster.MaterialList[0].KIDX.ToString();
            break;
        }
    }
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdEdit":
            fvTypeList.Visible = true;
            lbAddType.Visible  = false;
            gvTypeList.Visible = !gvTypeList.Visible;

            DetailMaterialTypeList typeDetail = new DetailMaterialTypeList();
            typeDetail.TypeIDX             = int.Parse(cmdArg);
            dataMaster.MaterialTypeList    = new DetailMaterialTypeList[1];
            dataMaster.MaterialTypeList[0] = typeDetail;
            dataMaster = serviceMaster.ActionDataMaster("materialtype", dataMaster, 20);

            setFormData(fvTypeList, FormViewMode.Edit, dataMaster.MaterialTypeList);
            break;
        }
    }
Beispiel #4
0
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdInsert":

            break;

        case "cmdEdit":
            fvMaterialRegList.Visible = true;
            divAction.Visible         = false;
            gvMaterialRegList.Visible = !gvMaterialRegList.Visible;

            DetailMaterialRegisterList matRegister = new DetailMaterialRegisterList();
            matRegister.RegIDX = int.Parse(cmdArg);
            dataMaster.MaterialRegisterList    = new DetailMaterialRegisterList[1];
            dataMaster.MaterialRegisterList[0] = matRegister;
            dataMaster = serviceMaster.ActionDataMaster("materialreg", dataMaster, 20);
            //litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.MaterialRegisterList[0]));
            setFormData(fvMaterialRegList, FormViewMode.Edit, dataMaster.MaterialRegisterList);
            DropDownList ddlMCodeE = (DropDownList)fvMaterialRegList.FindControl("ddlMCodeE");
            ddlMCodeE.SelectedValue = dataMaster.MaterialRegisterList[0].MIDX.ToString();

            Repeater      rptImagesE       = (Repeater)fvMaterialRegList.FindControl("rptImagesE");
            string        dirName          = imgPath + dataMaster.MaterialRegisterList[0].MCode + dataMaster.MaterialRegisterList[0].RCode;
            string[]      filesindirectory = Directory.GetFiles(Server.MapPath(dirName));
            List <String> images           = new List <string>(filesindirectory.Count());
            foreach (string item in filesindirectory)
            {
                images.Add(String.Format(dirName + "/{0}", Path.GetFileName(item)));
            }
            rptImagesE.DataSource = images;
            rptImagesE.DataBind();
            break;

        case "cmdCancel":
            break;
        }
    }
Beispiel #5
0
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdEdit":
            fvTypeList.Visible  = true;
            lbAddType.Visible   = false;
            gvKindList.Visible  = !gvKindList.Visible;
            gvAssetList.Visible = !gvAssetList.Visible;

            switch (matType)
            {
            case "kind":
                DetailKindList kindDetail = new DetailKindList();
                kindDetail.KIDX        = int.Parse(cmdArg);
                dataMaster.KindList    = new DetailKindList[1];
                dataMaster.KindList[0] = kindDetail;
                dataMaster             = serviceMaster.ActionDataMaster(matType, dataMaster, 20);
                //litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.SiteList[0]));
                setFormData(fvTypeList, FormViewMode.Edit, dataMaster.KindList);
                break;

            case "asset":
                DetailAssetList assetDetail = new DetailAssetList();
                assetDetail.AsIDX       = int.Parse(cmdArg);
                dataMaster.AssetList    = new DetailAssetList[1];
                dataMaster.AssetList[0] = assetDetail;
                dataMaster = serviceMaster.ActionDataMaster(matType, dataMaster, 20);
                //litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.SiteList[0]));
                setFormData(fvTypeList, FormViewMode.Edit, dataMaster.AssetList);
                break;
            }
            break;
        }
    }
Beispiel #6
0
 protected void getGridData(string dataName, DataMaster dataMaster, int actionType)
 {
     dataMaster = serviceMaster.ActionDataMaster(dataName, dataMaster, actionType);
     setGridData(gvMaterialReport, dataMaster.MaterialRegisterList);
 }
    protected void gvRowCommand(object sender, GridViewCommandEventArgs e)
    {
        string cmdName = e.CommandName.ToString();
        string cmdArg  = e.CommandArgument.ToString();

        switch (cmdName)
        {
        case "cmdInsert":
            break;

        case "cmdEdit":
            gvMaterialRecList.Visible = false;
            fvMaterialRecList.Visible = true;
            lbAddRec.Visible          = false;

            DetailMaterialRecordList matRecord = new DetailMaterialRecordList();
            matRecord.RecIDX = int.Parse(cmdArg);
            dataMaster.MaterialRecordList    = new DetailMaterialRecordList[1];
            dataMaster.MaterialRecordList[0] = matRecord;
            dataMaster = serviceMaster.ActionDataMaster("materialrec", dataMaster, 20);
            // litTest.Text = HttpUtility.HtmlDecode(funcWeb.ConvertObjectToXml(dataMaster.MaterialRecordList[0]));
            ViewState["vsItemLists"] = dataMaster;    //.MaterialRecordItemList;
            setFormData(fvMaterialRecList, FormViewMode.Edit, dataMaster.MaterialRecordList);

            //print document
            //litOrderNo.Text = dataMaster.MaterialRecordList[0].RecNo;
            //litOrderDate.Text = dataMaster.MaterialRecordList[0].RecDate;
            //litFromSite.Text = dataMaster.MaterialRecordList[0].RecFromSiteName;
            //litToSite.Text = dataMaster.MaterialRecordList[0].RecToSiteName;

            litRecComment.Text = dataMaster.MaterialRecordList[0].RecComment;

            if (dataMaster.MaterialRecordItemList != null)
            {
                gvPrint.DataSource = dataMaster.MaterialRecordItemList;
                gvPrint.DataBind();
            }
            else
            {
                DetailMaterialRecordItemList itemLists = new DetailMaterialRecordItemList();
                itemLists.RegIDX = 0;
                dataMaster.MaterialRecordItemList    = new DetailMaterialRecordItemList[1];
                dataMaster.MaterialRecordItemList[0] = itemLists;
                gvPrint.DataSource = dataMaster.MaterialRecordItemList;
                gvPrint.DataBind();
            }

            //create row
            GridViewRow row = new GridViewRow(0, -1, DataControlRowType.Header, DataControlRowState.Normal);

            ////spanned cell that will span the columns I don't want to give the additional header
            //TableCell left = new TableHeaderCell();
            //left.ColumnSpan = 6;
            //row.Cells.Add(left);

            //spanned cell that will span the columns i want to give the additional header
            TableCell totals = new TableHeaderCell();
            totals.ColumnSpan = gvPrint.Columns.Count;
            totals.Text       = "<table style=\"width: 100%;\" class=\"printDoc\">";
            totals.Text      += "    <tbody>";
            totals.Text      += "        <tr style=\"line-height: 30px;\">";
            totals.Text      += "            <td style=\"width: 80%; text-align: center;\">THAI OBAYASHI CORP., LTD.</td>";
            totals.Text      += "            <td style=\"width: 20%;\">No. ";
            totals.Text      += dataMaster.MaterialRecordList[0].RecNo;
            totals.Text      += "        </tr>";
            totals.Text      += "        <tr style=\"line-height: 60px;\">";
            totals.Text      += "           <td style=\"width: 80%; text-align: center;\">";
            totals.Text      += "                <h3><b>ORDER SHEET</b></h3>";
            totals.Text      += "            </td>";
            totals.Text      += "            <td style=\"width: 20%;\">Date ";
            totals.Text      += dataMaster.MaterialRecordList[0].RecDate;
            totals.Text      += "        </tr>";
            totals.Text      += "    </tbody>";
            totals.Text      += "</table>";
            totals.Text      += "<table style=\"width: 100%;\">";
            totals.Text      += "    <tbody>";
            totals.Text      += "        <tr style=\"line-height: 50px;\">";
            totals.Text      += "            <td style=\"width: 50%;\">FROM : ";
            totals.Text      += dataMaster.MaterialRecordList[0].RecFromSiteName;
            totals.Text      += "            <td style=\"width: 50%;\">TO : ";
            totals.Text      += dataMaster.MaterialRecordList[0].RecToSiteName;
            totals.Text      += "        </tr>";
            totals.Text      += "    </tbody>";
            totals.Text      += "</table>";
            row.Cells.Add(totals);

            //Add the new row to the gridview as the master header row
            //A table is the only Control (index[0]) in a GridView
            ((Table)gvPrint.Controls[0]).Rows.AddAt(0, row);
            //print document
            break;

        case "cmdCancel":
            break;
        }
    }