Example #1
0
 protected void ASPxGridTax_RowInserting(object sender, DevExpress.Web.Data.ASPxDataInsertingEventArgs e)
 {
     collectData();
     e.NewValues["ItemId"]    = currentItem;
     e.NewValues["RowStatus"] = Utility.Constant.ROWSTATUS_ACTIVE;
     ASPxGridTax.CancelEdit();
 }
Example #2
0
 public void initializeInsertingMode()
 {
     MODE        = "Add";
     currentItem = itemBO.addDefaultItem(session, Item.TYPEOFITEM.PRODUCT);
     if (currentItem != null)
     {
         ItemId = currentItem.ItemId;
         grdProductSupplier.AddNewRow();
         ASPxGridTax.AddNewRow();
         treelstProductUnits.StartEditNewNode(treelstProductUnits.RootNode.Key);
         formProductEdit.ShowOnPageLoad = true;
     }
 }
Example #3
0
        public void loadForm()
        {
            txtProductCode.IsValid      = true;
            txtProductName.IsValid      = true;
            cboProductRowStatus.IsValid = true;
            pcProduct.ActiveTabIndex    = 0;
            MODE        = "Edit";
            currentItem = session.GetObjectByKey <Item>(ItemId);
            if (currentItem != null)
            {
                txtProductCode.Text      = currentItem.Code;
                txtProductName.Text      = currentItem.Name;
                HtmlEditDescription.Html = currentItem.Description;
                try
                {
                    cboProductManufacturer.Value = currentItem.ManufacturerOrgId.OrganizationId;
                    cboProductManufacturer.Text  = currentItem.ManufacturerOrgId.Name;
                }
                catch (Exception e)
                {
                    //Issue dropdownlist ---START
                    //throw new Exception(String.Format("Kiểm tra lại OrganizationId {0}", currentItem.ManufacturerOrgId.OrganizationId));
                    //Issue dropdownlist ---END
                }
                formProductEdit.ShowOnPageLoad = true;
            }
            else
            {
                throw new Exception(string.Format("Not exist ItemId {0} in Item Table", ItemId));
            }

            ASPxGridTax.DataBind();
            loadLbType();
            grdProductSupplier.CancelEdit();
            treelstProductUnits.CancelEdit();
            formProductEdit.HeaderText = string.Format("{0} {1}", formProductEdit.HeaderText, currentItem.Code);
        }