Ejemplo n.º 1
0
    private void InsertData()
    {
        if (string.IsNullOrEmpty(lblBuyerID.Text))
        {
            lblBuyerID.Text = Guid.NewGuid().ToString();
        }
        string NewLoginId     = MudarAutoGenerate.GenerateULogin(txtCompanyname.Text);
        string NewPassword    = MudarAutoGenerate.GeneratePassword(txtCompanyname.Text);
        string Country        = txtCountry.Text.ToUpper();
        string companyaddress = txtAddress1.Text + "@" + txtAddress2.Text + "@" + txtAddress3.Text;

        result = BBL.BuyerDetails_INSandUPDandDEL(lblBuyerID.Text, txtCompanyname.Text, companyaddress, txtCity.Text, txtState.Text, txtZipCode.Text, Country, txtContatperson.Text, txtContactPhone.Text, txtMobile.Text, txtEmail.Text, txtWebsite.Text, txtNotifyName.Text, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, txtBankname.Text, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, "Bhanu", string.Empty, txtTIN.Text, txtVAT.Text, txtCST.Text, MudarApp.Insert, 0);
        if (result)
        {
            result = BRE.UserLogin_INS_UPD_DEL(lblBuyerID.Text, NewLoginId, NewPassword, "Bhanu", "bhanu", MudarApp.Insert);
            if (result)
            {
                result = BRE.UserInRoles_INS_UPD_DEL(WebConfigurationManager.AppSettings["BuyerRole"].ToString(), lblBuyerID.Text, "Bhanu", "bhanu", MudarApp.Insert);
            }
        }
        //MainBuyerView.ActiveViewIndex = 1;
        //btnTBuyerInfo.BackColor = System.Drawing.ColorTranslator.FromHtml("#FFFFB3");
        //btnTBuyerInfo.ForeColor = System.Drawing.ColorTranslator.FromHtml("Gray");
        //btnTContactInfo.ForeColor = System.Drawing.ColorTranslator.FromHtml("#FFFFFF");
    }
Ejemplo n.º 2
0
    protected void btnCompanyInfoNext_Click(object sender, EventArgs e)
    {
        if (string.IsNullOrEmpty(lblBuyerID.Text))
        {
            lblBuyerID.Text = Guid.NewGuid().ToString();
        }
        string NewLoginId     = MudarAutoGenerate.GenerateULogin(txtCompanyname.Text);
        string NewPassword    = MudarAutoGenerate.GeneratePassword(txtCompanyname.Text);
        string Country        = txtCountry.Text.ToUpper();
        string companyaddress = txtAddress1.Text + "@" + txtAddress2.Text + "@" + txtAddress3.Text;

        result = BBL.BuyerDetails_INSandUPDandDEL(lblBuyerID.Text, txtCompanyname.Text, companyaddress, txtCity.Text, txtState.Text, txtZipCode.Text, Country, txtContatperson.Text, txtContactPhone.Text, txtMobile.Text, txtEmail.Text, txtWebsite.Text, txtNotifyName.Text, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, txtBankname.Text, string.Empty, string.Empty, string.Empty, string.Empty, string.Empty, "Bhanu", string.Empty, txtTIN.Text, txtVAT.Text, txtCST.Text, MudarApp.Insert, 0);
        if (result)
        {
            result = BRE.UserLogin_INS_UPD_DEL(lblBuyerID.Text, NewLoginId, NewPassword, "Bhanu", "bhanu", MudarApp.Insert);
            if (result)
            {
                result = BRE.UserInRoles_INS_UPD_DEL(WebConfigurationManager.AppSettings["BuyerRole"].ToString(), lblBuyerID.Text, "Bhanu", "bhanu", MudarApp.Insert);
            }
        }
        if (txtCountry.Text.ToUpper() == "INDIA")
        {
            txtSea.Enabled = false;
            txtAir.Enabled = false;

            //price terms
            rbtnFOB.Enabled            = false;
            rbtnCIFbySea.Enabled       = false;
            rbtnCIFAirEandEUSA.Enabled = false;
            rbtnForDestination.Enabled = true;
            rbtnForDestination.Checked = true;
        }
        else
        {
            //price terms
            rbtnFOB.Enabled            = true;
            rbtnFOB.Checked            = true;
            rbtnCIFbySea.Enabled       = true;
            rbtnCIFAirEandEUSA.Enabled = true;
            rbtnForDestination.Enabled = false;
        }
        MainBuyerView.ActiveViewIndex = 1;
    }
        public bool CreateEmployee(string EmployeeName, string BranchId, string Phonenumber, string Mnumber, string address, string city, string taluk, string district, string state, string country, string CreatedBy, string ModifiedBy, int TypeOfOperation, List <string> RolesList)
        {
            bool Result = false;

            string NewUid      = Guid.NewGuid().ToString();
            string NewLoginId  = MudarAutoGenerate.GenerateULogin(EmployeeName);
            string NewPassword = MudarAutoGenerate.GeneratePassword(EmployeeName);

            Result = Employee_INS_UPT_DEL(NewUid, EmployeeName, BranchId, Phonenumber, Mnumber, address, city, taluk, district, state, country, CreatedBy, ModifiedBy, TypeOfOperation);
            if (Result)
            {
                Result = UserLogin_INS_UPD_DEL(NewUid, NewLoginId, NewPassword, CreatedBy, ModifiedBy, TypeOfOperation);
                if (Result)
                {
                    Email.SendLoginCredintials(EmployeeName, NewLoginId, NewPassword, "[email protected],[email protected]", "Mudar Organic Login Credintals");
                    foreach (string role in RolesList)
                    {
                        Result = UserInRoles_INS_UPD_DEL(role, NewUid, CreatedBy, ModifiedBy, TypeOfOperation);
                    }
                }
            }

            return(Result);
        }