예제 #1
0
        private void TxtShortName_Validating(object sender, System.ComponentModel.CancelEventArgs e)
        {
            if (_Tag == "" || ActiveControl == TxtShortName)
            {
                return;
            }
            if (TxtShortName.Enabled == false)
            {
                return;
            }

            if (string.IsNullOrEmpty(TxtShortName.Text.Trim()) && !string.IsNullOrEmpty(TxtDescription.Text.Trim()))
            {
                MessageBox.Show("Company Unit ShortName Cannot Left Blank...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                e.Cancel = true;
                TxtShortName.Focus();
                return;
            }
            else if (_Tag == "NEW")
            {
                if (_objCommon.CheckShortNameDuplicateRecord(TxtShortName.Text, "CompanyUnit", "CmpUnitShortName", "CompanyUnitId") == 1)
                {
                    MessageBox.Show("Company Unit ShortName Already Exist...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    e.Cancel = true;
                    TxtShortName.Focus();
                    return;
                }
            }
            else if (_Tag == "EDIT")
            {
                if (_objCommon.CheckShortNameDuplicateRecord(TxtShortName.Text, "CompanyUnit", "CmpUnitShortName", "CompanyUnitId", Convert.ToInt32(TxtDescription.Tag.ToString())) != 0)
                {
                    MessageBox.Show("Company Unit ShortName Already Exist...!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    e.Cancel = true;
                    return;
                }
            }
        }
예제 #2
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("Department Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("Department ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            try
            {
                _objDepartment.Model.Tag          = _Tag;
                _objDepartment.Model.DepartmentId = Convert.ToInt32(TxtDescription.Tag.ToString());
                if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
                {
                    ClearFld();
                    TxtDescription.Focus();
                    return;
                }
                _objDepartment.Model.DepartmentDesc      = TxtDescription.Text;
                _objDepartment.Model.DepartmentShortName = TxtShortName.Text;
                _objDepartment.Model.DepartmentLevel     = CmbType.Text;
                _objDepartment.Model.EnterBy             = ClsGlobal.LoginUserCode;
                _objDepartment.Model.Status = CbActive.Checked == true ? true : false;
                _objDepartment.Model.Gadget = "Desktop";
                if (_Tag == "NEW")
                {
                    if (ClsGlobal.ConfirmSave == 1)
                    {
                        DialogResult dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                        if (dialogResult == DialogResult.Yes)
                        {
                            result = _objDepartment.SaveDepartment();
                        }
                        else
                        {
                            return;
                        }
                    }
                    else
                    {
                        result = _objDepartment.SaveDepartment();
                    }
                }
                else
                {
                    result = _objDepartment.SaveDepartment();
                }
                if (!string.IsNullOrEmpty(result))
                {
                    if (_IsNew == 'Y')
                    {
                        _NewDepartment = TxtDescription.Text.Trim();
                        _DepartmentId  = Convert.ToInt32(result);
                        Close();
                    }
                    else
                    {
                        NavMenuDataList = _objDepartment.GetDataDepartment(0);
                        MessageBox.Show("Data submit successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                        ClearFld();
                    }
                }
                else
                {
                    MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.ToString(), "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #3
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("Godwon Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("Godwon ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objGodown.Model.Tag      = _Tag;
            _objGodown.Model.GodownId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                TxtDescription.Focus();
                return;
            }

            _objGodown.Model.GodownDesc        = TxtDescription.Text;
            _objGodown.Model.GodownShortName   = TxtShortName.Text;
            _objGodown.Model.LedgerId          = ((TxtLedger.Tag.ToString() == "") ? 0 : Convert.ToInt32(TxtLedger.Tag.ToString()));
            _objGodown.Model.Country           = TxtCountry.Text;
            _objGodown.Model.Address           = TxtAddress.Text;
            _objGodown.Model.PhoneNo           = TxtPhoneNo.Text;
            _objGodown.Model.Fax               = TxtFax.Text;
            _objGodown.Model.ContactPerson     = TxtContactPerson.Text;
            _objGodown.Model.ContactPersonAdd  = TxtContactPersonAdd.Text;
            _objGodown.Model.ContPersonPhoneNo = TxtContPersonPhoneNo.Text;
            _objGodown.Model.EnterBy           = ClsGlobal.LoginUserCode;
            _objGodown.Model.Status            = CbActive.Checked == true ? true : false;
            _objGodown.Model.Gadget            = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    var dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objGodown.SaveGodown();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objGodown.SaveGodown();
                }
            }
            else
            {
                result = _objGodown.SaveGodown();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewGodown = TxtDescription.Text.Trim();
                    _GodownId  = Convert.ToInt32(result);
                    this.Close();
                }
                else
                {
                    NavMenuDataList = _objGodown.GetDataGodown(0);
                    MessageBox.Show("Data submit successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearFld();
                }
            }
            else
            {
                MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #4
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("ProductGroup2 Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("ProductGroup2 ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objProductGroup.Model.Tag          = _Tag;
            _objProductGroup.Model.ProductGrpId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                return;
            }
            _objProductGroup.Model.ProductGrpDesc        = TxtDescription.Text;
            _objProductGroup.Model.ProductGrpShortName   = TxtShortName.Text;
            _objProductGroup.Model.ProductGrpMargin      = ClsGlobal.ReturnDecimalVal(TxtMargin.Text);
            _objProductGroup.Model.ProductGrpPrinterName = CmbPrinter.Text;
            _objProductGroup.Model.Status  = CbActive.Checked == true ? true : false;
            _objProductGroup.Model.EnterBy = ClsGlobal.LoginUserCode;
            _objProductGroup.Model.Gadget  = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    var dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objProductGroup.SaveProductGroup("ProductGroup2");
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objProductGroup.SaveProductGroup("ProductGroup2");
                }
            }
            else
            {
                result = _objProductGroup.SaveProductGroup("ProductGroup2");
            }


            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewProductGroup = TxtDescription.Text.Trim();
                    _ProductGrpId    = Convert.ToInt32(result);
                    this.Close();
                }
                else
                {
                    NavMenuDataList = _objProductGroup.GetDataProductGroup(0, "ProductGroup2");
                    MessageBox.Show("Data submit successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearFld();
                }
            }
            else
            {
                MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #5
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("Table Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("Table ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }
            if (string.IsNullOrEmpty(CmbFloor.Text))
            {
                MessageBox.Show("Floor cannot be left blank.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                CmbFloor.Focus();
                return;
            }
            _objTable.Model.Tag            = _Tag;
            _objTable.Model.TableId        = Convert.ToInt32(TxtDescription.Tag.ToString());
            _objTable.Model.TableDesc      = TxtDescription.Text;
            _objTable.Model.TableShortName = TxtShortName.Text;
            _objTable.Model.FloorId        = ((CmbFloor.Text.ToString() == "") ? 0 : Convert.ToInt32(((KeyValuePair <string, string>)CmbFloor.SelectedItem).Key));
            _objTable.Model.TableType      = CmbType.Text;
            _objTable.Model.TableStatus    = "A";
            _objTable.Model.EnterBy        = ClsGlobal.LoginUserCode;
            _objTable.Model.Status         = CbActive.Checked == true ? true : false;
            _objTable.Model.Gadget         = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    var dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objTable.SaveTable();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objTable.SaveTable();
                }
            }
            else
            {
                result = _objTable.SaveTable();
            }


            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewTable = TxtDescription.Text.Trim();
                    _TableId  = Convert.ToInt32(result);
                    this.Close();
                }
                else
                {
                    NavMenuDataList = _objTable.GetDataTable(0);
                    MessageBox.Show("Data Submit Successfully", "Mr Solution");
                    ClearFld();
                    TxtDescription.Focus();
                }
            }
            else
            {
                MessageBox.Show("Error Occured During Data Submit", "Mr Solution");
            }
        }
예제 #6
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("Counter Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("Counter ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objCounter.Model.Tag       = _Tag;
            _objCounter.Model.CounterId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                return;
            }
            _objCounter.Model.CounterDesc      = TxtDescription.Text;
            _objCounter.Model.CounterShortName = TxtShortName.Text;
            _objCounter.Model.PrinterName      = CmbPrinterName.Text;
            _objCounter.Model.GodownId         = ((TxtGodown.Tag.ToString() == "") ? 0 : Convert.ToInt32(TxtGodown.Tag.ToString()));
            _objCounter.Model.EnterBy          = ClsGlobal.LoginUserCode;
            _objCounter.Model.Status           = CbActive.Checked == true ? true : false;
            _objCounter.Model.Gadget           = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    if (MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error) == DialogResult.Yes)
                    {
                        result = _objCounter.SaveCounter();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objCounter.SaveCounter();
                }
            }
            else
            {
                result = _objCounter.SaveCounter();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewCounter = TxtDescription.Text.Trim();
                    _CounterId  = Convert.ToInt32(result);
                    Close();
                }
                else
                {
                    NavMenuDataList = _objCounter.GetDataCounter(0);
                    ClsGlobal.SaveMessage(_Tag);
                    ClearFld();
                }
            }
            else
            {
                ClsGlobal.ErrorMessage("");
            }
        }
예제 #7
0
        private void FxSave()
        {
            string lName      = TxtName.Text.Trim();
            string lTradeName = TxtTradeName.Text.Trim();
            string lShortName = TxtShortName.Text.Trim();
            string lDBName    = TxtDBName.Text.Trim();

            bool lEnabled = ChkEnabled.Checked;

            if (lName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre de compañia");

                TxtName.Text = "";

                TxtName.Focus();

                return;
            }

            if (lTradeName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre de comercio");

                TxtTradeName.Text = "";

                TxtTradeName.Focus();

                return;
            }

            if (lShortName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese nombre corto");

                TxtShortName.Text = "";

                TxtShortName.Focus();

                return;
            }

            if (lDBName.Length < 3)
            {
                ClsFunctions.FxMessage(1, "Ingrese Base de datos");

                TxtDBName.Text = "";

                TxtDBName.Focus();

                return;
            }

            if (ClsFunctions.FxMessage(2, "¿Está seguro de guardar los cambios?") == true)
            {
                long lCompanyId_new;

                if (lCompanyId == 0)
                {
                    lCompanyId_new = ClsSqlAdministrator.Fx_ins_tblCompany(lName, lTradeName, lShortName, lDBName);
                }
                else
                {
                    lCompanyId_new = ClsSqlAdministrator.Fx_upt_tblCompany(lCompanyId, lName, lTradeName, lShortName, lDBName, lEnabled);
                }

                if (lCompanyId_new > 0)
                {
                    FxExit();
                }
            }
        }
예제 #8
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text.Trim()))
            {
                MessageBox.Show("Account Group Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text.Trim()))
            {
                MessageBox.Show("Account Group ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objAccountGroup.Model.Tag          = _Tag;
            _objAccountGroup.Model.AccountGrpId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                return;
            }
            _objAccountGroup.Model.AccountGrpDesc      = TxtDescription.Text.Trim();
            _objAccountGroup.Model.AccountGrpShortName = TxtShortName.Text.Trim();
            _objAccountGroup.Model.Schedule            = TxtSchedule.Text == "" ? 0 : Convert.ToInt32(TxtSchedule.Text);
            _objAccountGroup.Model.EnterBy             = ClsGlobal.LoginUserCode;
            _objAccountGroup.Model.GrpType             = CmbType.SelectedValue.ToString();         //((KeyValuePair<string, string>)CmbType.SelectedItem).Key;
            _objAccountGroup.Model.PrimaryGrp          = CmbPrimaryGroup.SelectedValue.ToString(); //((KeyValuePair<string, string>) CmbPrimaryGroup.SelectedItem).Key;
            _objAccountGroup.Model.Status = CbActive.Checked == true ? true : false;
            _objAccountGroup.Model.Gadget = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    DialogResult dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objAccountGroup.SaveAccountGroup();
                    }
                }
                else
                {
                    result = _objAccountGroup.SaveAccountGroup();
                }
            }
            else
            {
                result = _objAccountGroup.SaveAccountGroup();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewAccountGroup = TxtDescription.Text.Trim();
                    _AccountGrpId    = Convert.ToInt32(result);
                    Close();
                }
                else
                {
                    NavMenuDataList = _objAccountGroup.GetDataAccountGroup(0);
                    ClsGlobal.SaveMessage(_Tag);
                    ClearFld();
                    if (_Tag == "NEW")
                    {
                        TxtSchedule.Text = _objAccountGroup.GetSchedule();
                    }
                }
            }
            else
            {
                MessageBox.Show("Account group already in used.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #9
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text.Trim()))
            {
                MessageBox.Show("Membership Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text.Trim()))
            {
                MessageBox.Show("Membership ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objSalesman.Model.Tag        = _Tag;
            _objSalesman.Model.SalesmanId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                return;
            }
            _objSalesman.Model.SalesmanDesc      = TxtDescription.Text;
            _objSalesman.Model.SalesmanShortName = TxtShortName.Text;
            _objSalesman.Model.Address           = TxtAddress.Text;
            _objSalesman.Model.PhoneNo           = TxtPhoneNo.Text;
            _objSalesman.Model.MobileNo          = TxtMobileNo.Text;
            _objSalesman.Model.EmailId           = TxtEmail.Text;
            _objSalesman.Model.Fax            = "";
            _objSalesman.Model.Country        = TxtCountry.Text;
            _objSalesman.Model.CommissionRate = 0;
            _objSalesman.Model.CreditLimit    = 0;
            _objSalesman.Model.CreditDays     = 0;
            _objSalesman.Model.BranchId       = ClsGlobal.BranchId;
            _objSalesman.Model.CompanyUnitId  = ClsGlobal.CompanyUnitId;
            _objSalesman.Model.MemberTypeId   = ((CmbMemberType.Text.ToString() == "") ? 0 : Convert.ToInt32(((KeyValuePair <string, string>)CmbMemberType.SelectedItem).Key));
            _objSalesman.Model.MemberFromDate = Convert.ToDateTime(TxtFromDate.Text.ToString());
            _objSalesman.Model.MemberToDate   = Convert.ToDateTime(TxtToDate.Text.ToString());
            _objSalesman.Model.MembershipId   = TxtMembershipId.Text.ToString();
            _objSalesman.Model.EnterBy        = ClsGlobal.LoginUserCode;
            _objSalesman.Model.Status         = CbActive.Checked == true ? true : false;
            _objSalesman.Model.Gadget         = "Desktop";
            _objSalesman.Model.CustomerType   = "Normal";
            _objSalesman.Model.SalesmanType   = "Member";
            _objSalesman.Model.GLShortName    = _objCommon.GenerateShortName(TxtDescription.Text, "GlDesc", "GlShortName", "GeneralLedger");
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    DialogResult dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objSalesman.SaveSalesman();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objSalesman.SaveSalesman();
                }
            }
            else
            {
                result = _objSalesman.SaveSalesman();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewSubSalesman = TxtDescription.Text.Trim();
                    _SalesmanId     = Convert.ToInt32(result);
                    Close();
                }
                else
                {
                    NavMenuDataList = _objSalesman.GetDataSalesman(0);
                    ClearFld();
                }
                _objSalesman.Model.GSalesmanId = Convert.ToInt32(result);

                if (_Tag == "NEW")
                {
                    string Res = _objSalesman.SaveLedger();
                    if (string.IsNullOrEmpty(Res))
                    {
                        _objSalesman.Model.Tag        = "DELETE";
                        _objSalesman.Model.SalesmanId = Convert.ToInt32(result);
                        _objSalesman.SaveSalesman();
                        MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                }
                else
                {
                    MessageBox.Show("Data submit successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
            }
            else
            {
                MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #10
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("SalesMan Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("SalesMan ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }


            _objSalesman.Model.Tag        = _Tag;
            _objSalesman.Model.SalesmanId = Convert.ToInt32(TxtDescription.Tag.ToString());
            if ((_Tag == "EDIT" || _Tag == "DELETE") && Convert.ToInt32(TxtDescription.Tag.ToString()) == 0)
            {
                ClearFld();
                return;
            }

            _objSalesman.Model.SalesmanDesc      = TxtDescription.Text;
            _objSalesman.Model.SalesmanShortName = TxtShortName.Text;
            _objSalesman.Model.LedgerId          = ((TxtLedger.Tag.ToString() == "") ? 0 : Convert.ToInt32(TxtLedger.Tag.ToString()));
            _objSalesman.Model.MainSalesmanId    = ((TxtMainSalesMan.Tag.ToString() == "") ? 0 : Convert.ToInt32(TxtMainSalesMan.Tag.ToString()));
            _objSalesman.Model.Address           = TxtAddress.Text;
            _objSalesman.Model.PhoneNo           = TxtPhoneNo.Text;
            _objSalesman.Model.MobileNo          = TxtMobileNo.Text;
            _objSalesman.Model.EmailId           = TxtEmail.Text;
            _objSalesman.Model.Fax            = TxtFax.Text;
            _objSalesman.Model.Country        = TxtCountry.Text;
            _objSalesman.Model.CommissionRate = ((TxtCommissionRate.Text.ToString() == "") ? 0 : Convert.ToDecimal(TxtCommissionRate.Text.ToString()));
            _objSalesman.Model.CreditLimit    = ((TxtCreditLimit.Text.ToString() == "") ? 0 : Convert.ToDecimal(TxtCreditLimit.Text.ToString()));
            _objSalesman.Model.CreditDays     = Convert.ToInt32((TxtCreditDays.Text.ToString() == "") ? 0 : Convert.ToInt32(TxtCreditDays.Text.ToString()));
            _objSalesman.Model.BranchId       = ClsGlobal.BranchId;
            _objSalesman.Model.CompanyUnitId  = ClsGlobal.CompanyUnitId;
            _objSalesman.Model.EnterBy        = ClsGlobal.LoginUserCode;
            _objSalesman.Model.Status         = CbActive.Checked == true ? true : false;
            _objSalesman.Model.Gadget         = "Desktop";
            _objSalesman.Model.SalesmanType   = "";
            _objSalesman.Model.MembershipId   = "";
            _objSalesman.Model.MemberFromDate = null;
            _objSalesman.Model.MemberToDate   = null;
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    var dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objSalesman.SaveSalesman();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objSalesman.SaveSalesman();
                }
            }
            else
            {
                result = _objSalesman.SaveSalesman();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewSubSalesMan = TxtDescription.Text.Trim();
                    _SalesmanId     = Convert.ToInt32(result);
                    this.Close();
                }
                else
                {
                    NavMenuDataList = _objSalesman.GetDataSalesman(0);
                    MessageBox.Show("Data submit successfully", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    ClearFld();
                    TxtDescription.Focus();
                }
            }
            else
            {
                MessageBox.Show("Error occured during data submit", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }
예제 #11
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("SubLedger Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("SubLedger ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            if (string.IsNullOrEmpty(TxtDescription.Text))
            {
                MessageBox.Show("Subledger Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text))
            {
                MessageBox.Show("Subledger ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }

            _objSubledger.Model.Tag                = _Tag;
            _objSubledger.Model.SubledgerId        = Convert.ToInt32(TxtDescription.Tag.ToString());
            _objSubledger.Model.SubledgerDesc      = TxtDescription.Text;
            _objSubledger.Model.SubledgerShortName = TxtShortName.Text;
            _objSubledger.Model.LedgerId           = ((TxtLedger.Tag.ToString() == "") ? 0 : Convert.ToInt64(TxtLedger.Tag.ToString()));
            _objSubledger.Model.Country            = TxtCountry.Text;
            _objSubledger.Model.Address            = TxtAddress.Text;
            _objSubledger.Model.PhoneNo            = TxtPhoneNo.Text;
            _objSubledger.Model.MobileNo           = TxtMobileNo.Text;
            _objSubledger.Model.Fax                = TxtFax.Text;
            _objSubledger.Model.EmailId            = TxtEmailId.Text;
            _objSubledger.Model.BankAccountNo      = TxtBankAccountNo.Text;
            _objSubledger.Model.InterestRate       = ((TxtInterestRate.Text.ToString() == "") ? 0 : Convert.ToDecimal(TxtInterestRate.Text));
            _objSubledger.Model.NationalId         = TxtNationalId.Text;
            _objSubledger.Model.PanNo              = TxtPanNo.Text;
            _objSubledger.Model.EnterBy            = ClsGlobal.LoginUserCode;
            _objSubledger.Model.Status             = CbActive.Checked == true ? true : false;
            _objSubledger.Model.Gadget             = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    var dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objSubledger.SaveSubledger();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objSubledger.SaveSubledger();
                }
            }
            else
            {
                result = _objSubledger.SaveSubledger();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewSubLedger = TxtDescription.Text.Trim();
                    _SubledgerId  = Convert.ToInt32(result);
                    Close();
                }
                else
                {
                    NavMenuDataList = _objSubledger.GetDataSubledger(0);
                    MessageBox.Show("Data Submit Successfully", "Mr Solution");
                    ClearFld();
                    TxtDescription.Focus();
                }
            }
            else
            {
                MessageBox.Show("Error Occured During Data Submit", "Mr Solution");
            }
        }
예제 #12
0
        private void BtnSave_Click(object sender, EventArgs e)
        {
            if (string.IsNullOrEmpty(TxtDescription.Text.Trim()))
            {
                MessageBox.Show("Cost Center Description is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtDescription.Focus();
                return;
            }
            if (string.IsNullOrEmpty(TxtShortName.Text.Trim()))
            {
                MessageBox.Show("Cost Center ShortName is Required..!!", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
                TxtShortName.Focus();
                return;
            }
            _objCostCenter.Model.Tag                 = _Tag;
            _objCostCenter.Model.CostCenterId        = Convert.ToInt32(TxtDescription.Tag.ToString());
            _objCostCenter.Model.CostCenterDesc      = TxtDescription.Text;
            _objCostCenter.Model.CostCenterShortName = TxtShortName.Text;
            _objCostCenter.Model.LedgerId            = ((TxtLedger.Tag.ToString() == "") ? 0 : Convert.ToInt64(TxtLedger.Tag.ToString()));
            _objCostCenter.Model.Address             = TxtAddress.Text;
            _objCostCenter.Model.Country             = TxtCountry.Text;
            _objCostCenter.Model.PhoneNo             = TxtPhoneNo.Text;
            _objCostCenter.Model.MobileNo            = TxtMobileNo.Text;
            _objCostCenter.Model.ContactPerson       = TxtContactPerson.Text;
            _objCostCenter.Model.ContactPersonAdd    = TxtContactAddress.Text;
            _objCostCenter.Model.ContPersonPhoneNo   = TxtContactPhone.Text;
            _objCostCenter.Model.EnterBy             = ClsGlobal.LoginUserCode;
            _objCostCenter.Model.Status              = CbActive.Checked == true ? true : false;
            _objCostCenter.Model.Gadget              = "Desktop";
            if (_Tag == "NEW")
            {
                if (ClsGlobal.ConfirmSave == 1)
                {
                    DialogResult dialogResult = MessageBox.Show("Are you sure want to Save New Record..??", "Close Form", MessageBoxButtons.YesNo, MessageBoxIcon.Error);
                    if (dialogResult == DialogResult.Yes)
                    {
                        result = _objCostCenter.SaveCostCenter();
                    }
                    else
                    {
                        return;
                    }
                }
                else
                {
                    result = _objCostCenter.SaveCostCenter();
                }
            }
            else
            {
                result = _objCostCenter.SaveCostCenter();
            }

            if (!string.IsNullOrEmpty(result))
            {
                if (_IsNew == 'Y')
                {
                    _NewCostCenter = TxtDescription.Text.Trim();
                    _CostCenterId  = Convert.ToInt32(result);
                    Close();
                }
                else
                {
                    NavMenuDataList = _objCostCenter.GetDataCostCenter(0);
                    ClsGlobal.SaveMessage(_Tag);
                    ClearFld();
                    TxtDescription.Focus();
                }
            }
            else
            {
                MessageBox.Show("Cost center already in used.", "Mr Solution", MessageBoxButtons.OK, MessageBoxIcon.Information);
            }
        }