Пример #1
0
        protected void gridListInvoice_DetailRowExpandedChanged(object sender, ASPxGridViewDetailRowEventArgs e)
        {
            //initialize control
            BootstrapGridView grid             = (BootstrapGridView)sender;
            BootstrapTextBox  txtInvoiceNumber = (BootstrapTextBox)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtInvoiceNumber");
            BootstrapTextBox  txtApproveBy     = (BootstrapTextBox)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtApproveBy");
            BootstrapDateEdit dateInvoice      = (BootstrapDateEdit)grid.FindDetailRowTemplateControl(e.VisibleIndex, "dateInvoice");
            BootstrapMemo     txtNote          = (BootstrapMemo)grid.FindDetailRowTemplateControl(e.VisibleIndex, "txtNote");

            //bind control
            if (txtInvoiceNumber == null)
            {
                return;
            }

            txtInvoiceNumber.Text = grid.GetRowValues(e.VisibleIndex, "InvoiceNumber").ToString();
            txtApproveBy.Text     = grid.GetRowValues(e.VisibleIndex, "ApproveBy") != null?grid.GetRowValues(e.VisibleIndex, "ApproveBy").ToString() : string.Empty;

            txtNote.Text = grid.GetRowValues(e.VisibleIndex, "Note") != null?grid.GetRowValues(e.VisibleIndex, "Note").ToString() : string.Empty;

            DateTime InvoiceDate = Convert.ToDateTime(grid.GetRowValues(e.VisibleIndex, "InvoiceDate"));

            if (InvoiceDate != DateTime.Parse("1/1/1900"))
            {
                dateInvoice.Value = InvoiceDate;
            }
            else
            {
                dateInvoice.Value = null;
            }
        }
Пример #2
0
        protected MasterDataModel.MasterDataTBBM GetGvValue(BootstrapGridView gv, int key = 0)
        {
            BootstrapTextBox  txtName    = gv.FindEditFormTemplateControl("txtName") as BootstrapTextBox;
            BootstrapComboBox cmbRegion  = gv.FindEditFormTemplateControl("cmbRegion") as BootstrapComboBox;
            BootstrapMemo     txtAddress = gv.FindEditFormTemplateControl("txtAddress") as BootstrapMemo;
            BootstrapTextBox  txtTelp    = gv.FindEditFormTemplateControl("txtTelp") as BootstrapTextBox;
            BootstrapTextBox  txtEmail   = gv.FindEditFormTemplateControl("txtEmail") as BootstrapTextBox;

            MasterDataModel.MasterDataTBBM item = new MasterDataModel.MasterDataTBBM();
            item.TBBM_ID_PK   = key;
            item.Region_ID_FK = Convert.ToByte(cmbRegion.Value);
            item.Name         = txtName.Text;
            item.Address      = txtAddress.Text;
            item.Telp         = txtTelp.Text;
            item.Email        = txtEmail.Text;
            item.CreationBy   = UserProfile.Username;
            item.UpdateBy     = UserProfile.Username;

            return(item);
        }
        protected MasterDataModel.MasterDataTransporter GetGvValue(BootstrapGridView gv, int key = 0)
        {
            BootstrapTextBox txtName     = gv.FindEditFormTemplateControl("txtName") as BootstrapTextBox;
            BootstrapMemo    txtAddress  = gv.FindEditFormTemplateControl("txtAddress") as BootstrapMemo;
            BootstrapTextBox txtEmail    = gv.FindEditFormTemplateControl("txtEmail") as BootstrapTextBox;
            BootstrapTextBox txtPhone    = gv.FindEditFormTemplateControl("txtPhone") as BootstrapTextBox;
            BootstrapTextBox txtContact1 = gv.FindEditFormTemplateControl("txtContact1") as BootstrapTextBox;
            BootstrapTextBox txtContact2 = gv.FindEditFormTemplateControl("txtContact2") as BootstrapTextBox;

            MasterDataModel.MasterDataTransporter item = new MasterDataModel.MasterDataTransporter();
            item.Transporter_ID  = key;
            item.TransporterName = txtName.Text;
            item.Address         = txtAddress.Text;
            item.Email           = txtEmail.Text;
            item.Phone           = txtPhone.Text;
            item.Contact1        = txtContact1.Text;
            item.Contact2        = txtContact2.Text;
            item.CreationBy      = UserProfile.Username;
            item.UpdateBy        = UserProfile.Username;

            return(item);
        }
        protected MasterDataModel.MasterDataDriver GetGvValue(BootstrapGridView gv, int key = 0)
        {
            BootstrapTextBox  txtName        = gv.FindEditFormTemplateControl("txtName") as BootstrapTextBox;
            BootstrapComboBox cmbTransportir = gv.FindEditFormTemplateControl("cmbTransportir") as BootstrapComboBox;
            BootstrapDateEdit deBirthday     = gv.FindEditFormTemplateControl("deBirthday") as BootstrapDateEdit;
            BootstrapMemo     txtAddress     = gv.FindEditFormTemplateControl("txtAddress") as BootstrapMemo;
            BootstrapTextBox  txtEmail       = gv.FindEditFormTemplateControl("txtEmail") as BootstrapTextBox;
            BootstrapTextBox  txtPhone1      = gv.FindEditFormTemplateControl("txtPhone1") as BootstrapTextBox;
            BootstrapTextBox  txtPhone2      = gv.FindEditFormTemplateControl("txtPhone2") as BootstrapTextBox;

            MasterDataModel.MasterDataDriver item = new MasterDataModel.MasterDataDriver();
            item.Driver_ID      = key;
            item.Name           = txtName.Text;
            item.Transporter_ID = Convert.ToInt32(cmbTransportir.Value);
            if (deBirthday.Value != null)
            {
                item.Birthday = deBirthday.Date;
            }
            else
            {
                item.Birthday = null;
            }
            item.Address    = txtAddress.Text;
            item.Email      = txtEmail.Text;
            item.Phone1     = txtPhone1.Text;
            item.Phone2     = txtPhone2.Text;
            item.CreationBy = UserProfile.Username;
            item.UpdateBy   = UserProfile.Username;
            if (Session["DriverPhotoImageName"] != null && Session["DriverPhotoImageBytes"] != null)
            {
                item.ImageName  = Convert.ToString(Session["DriverPhotoImageName"]);
                item.ImageBytes = (byte[])Session["DriverPhotoImageBytes"];
                Session["DriverPhotoImageName"]  = null;
                Session["DriverPhotoImageBytes"] = null;
            }

            return(item);
        }