示例#1
0
    protected void btnSave_Click(object sender, EventArgs e)
    {
        string vISOStandard = "";

        if ((chkISOStandard_white.Items[0].Selected == true) && (chkISOStandard_white.Items[1].Selected == true))
        {
            vISOStandard = "11";
        }
        else if ((chkISOStandard_white.Items[0].Selected == true) && (chkISOStandard_white.Items[1].Selected == false))
        {
            vISOStandard = "10";
        }
        else if ((chkISOStandard_white.Items[0].Selected == false) && (chkISOStandard_white.Items[1].Selected == true))
        {
            vISOStandard = "01";
        }
        else
        {
            vISOStandard = "00";
        }


        SupplierTransaction s = new SupplierTransaction();
        int i = s.UpdateSupplier(connstring, ViewState["VendorId"].ToString().Trim(), ddlSupplierType.SelectedItem.Value.Trim(), ddlPCABClass.SelectedItem.Value.Trim(), vISOStandard);

        s.DeleteVendorCategorySubCategory(connstring, ViewState["VendorId"].ToString().Trim());
        string vSubCategory = hdnSubCategory.Text.Trim();

        string[] VendorSubCategory = vSubCategory.Split(Convert.ToChar(","));
        s.InsertSubCategory(connstring, ViewState["VendorId"].ToString().Trim(), VendorSubCategory);
        string vCategory = hdnCategories.Text.Trim();

        string[] VendorCategory = vCategory.Split(Convert.ToChar(","));
        s.InsertCategory(connstring, ViewState["VendorId"].ToString().Trim(), VendorCategory);
        s.DeleteBSLP(connstring, ViewState["VendorId"].ToString().Trim());
        s.InsertBrandsMain(connstring, Session["VendorId"].ToString().Trim(), hdnBrands.Text.Trim());
        s.InsertItemsCarriedMain(connstring, Session["VendorId"].ToString().Trim(), hdnItems.Text.Trim());
        s.InsertServicesOfferedMain(connstring, Session["VendorId"].ToString().Trim(), hdnServices.Text.Trim());
        s.InsertLocationMain(connstring, Session["VendorId"].ToString().Trim(), hdnLocation.Text.Trim());

        Session["VendorId"] = ViewState["VendorId"].ToString().Trim();
        Response.Redirect("supplierdetails.aspx");
    }