Ejemplo n.º 1
0
        void AddUpdateData()
        {
            try
            {
                ep1.Clear();

                if (string.IsNullOrEmpty(txtName.Text.Trim()))
                {
                    ep1.SetError(txtName, "Name is Required..");
                    txtName.Focus();
                    return;
                }


                decimal dTM02_PRICE1 = 0, dTM02_PRICE2 = 0;
                decimal.TryParse(txtPrice.Text.Trim(), out dTM02_PRICE1);


                int iTM02_PRODUCTSIZEID1 = 0, iTM02_PRODUCTSIZEID2 = 0;
                int.TryParse(lblSizeId1.Text.Trim(), out iTM02_PRODUCTSIZEID1);
                int.TryParse(lblSizeId2.Text.Trim(), out iTM02_PRODUCTSIZEID2);

                MyDa = new MyDabaseDataContext(Properties.Settings.Default.Style_King_Dev);
                int?Iout = 0;
                MyDa.USP_VP_ADD_PRODUCT(Datalayer.iTM01_PRODUCTID, txtName.Text.Trim(), chkIsSet.Checked, txtHSNCode.Text.Trim(), dTM02_PRICE1, Datalayer.iT001_COMPANYID, ref Iout);
                if (Iout > 0)
                {
                    Datalayer.InsertMessageBox(sPageName);
                }
                else
                {
                    Datalayer.DosenotInsertMessageBox(sPageName);
                }

                PopualteData();
                ResetData();
            }
            catch (Exception ex)
            {
                Datalayer.WorningMessageBox(ex.Message.ToString(), "Error");
            }
        }