Exemplo n.º 1
0
        private void InsUpdDelBranch(char Event, int id)
        {
            var msg = "";

            if (Event == 'I' || Event == 'U')
            {
                DateTime date      = ConvertNE.convertNepaliToEnglish(txtoperationstartdate.Text);
                var      objBranch = new Branch(id, txtbranchname.Text, txtbranchcode.Text, txtaddress.Text, txtemailid.Text,
                                                txttelno.Text, txtcontactpersonname.Text, date, chkismain.Checked);
                msg = BL_Branch.InsUpdDelBranch(Event, objBranch, out id);
            }
            else
            {
                var objBranch = new Branch(id, "", "", "", "", "", "", Convert.ToDateTime("01/01/1753"), true);
                msg = BL_Branch.InsUpdDelBranch(Event, objBranch, out id);
            }

            if (DatabaseMessage.ContainMessage(msg))
            {
                _msgbox.ShowSuccess(msg);
            }
            else
            {
                _msgbox.ShowWarning(msg);
            }
            FillGridview();
            ClearAll();
        }
Exemplo n.º 2
0
        private void InsUpdDelCompanyInfo(char Event, string Id)
        {
            try
            {
                BL_CompanyInfoDrose obj = new BL_CompanyInfoDrose();
                string CompanyName      = txtCompanyName.Text;
                string CompanyName1     = CompanyName.Substring(0, 10);
                int    cc           = CompanyName.Length - 10;
                string CompanyName2 = CompanyName.Substring(10, cc);
                obj.EVENT = Event;
                obj.Co_ID = 0;
                if (Event == 'I' || Event == 'U')
                {
                    obj.CompanyName     = txtCompanyName.Text;
                    obj.RegistrationNo  = txtRegistrationNo.Text;
                    obj.PanNo           = (txtPanNo.Text);
                    obj.Country         = (txtCountry.Text);
                    obj.State           = (txtState.Text);
                    obj.City            = (txtCity.Text);
                    obj.Adress1         = (txtAddress1.Text);
                    obj.Adress2         = (txtAddress2.Text);
                    obj.TelephoneNo     = (txtTelephoneNo.Text);
                    obj.EmailAdress     = (txtEmailAddress.Text);
                    obj.WebAdress       = (txtWebAddress.Text);
                    obj.C1              = (CompanyName1);
                    obj.C2              = (CompanyName2);
                    obj.MC              = "";
                    obj.Created_Date    = (ConvertNE.convertNepaliToEnglish(txtDate.Text).ToString());
                    obj.COMPANY_CODE    = Id;
                    obj.ADMIN_USER_NAME = (txtUserName.Text);
                    obj.PWD             = (txtPassword.Text);
                    obj.IMAGES_DRIVE    = txtImagesDrive.Text;


                    obj.CONTACT_PERSON_NAME = txtContactAddress.Text;
                    obj.EMAIL_ADDRESS       = txtEmailAdd.Text;
                    obj.MIRROR_AC_DROSE     = txtMirrorDrose.Text;
                    obj.MIRROR_AC_NCB       = txtMirrorNCB.Text;
                    obj.NOSTRO_AC_NCB       = txtNostroAcNCB.Text;
                    obj.MOB_NO    = txtMobNo.Text;
                    obj.C_ADDRESS = txtContactAddress.Text;
                    obj.C_TEL_NO  = txtTelNo.Text;
                }
                string msg = obj.InsUpdDelCompanyInfo(out Id);
                if (msg == "Record Inserted Successfully" || msg == "Record Updated Successfully" || msg == "Record Deleted Successfully")
                {
                    string path = txtImagesDrive.Text + Id.ToString();
                    if (!Directory.Exists(path))
                    {
                        Directory.CreateDirectory(path);
                    }
                    string p = picUpload(FileUpload1, path);
                    if (p == "url")
                    {
                        p = "nophoto.gif";
                    }

                    //Check Info In Company Code
                    // BL_CompanyInfoDrose.
                    msgbox.ShowSuccess(msg);
                    Response.Redirect("~/Common/OrganizationList.aspx");
                    ExecuteQuery(Id);
                    Clear();
                }
                else
                {
                    msgbox.ShowWarning(msg);
                }
            }
            catch (Exception ex)
            {
                msgbox.ShowWarning(ex.Message);
            }
        }