示例#1
0
        protected void loadCompanySection()
        {
            if (Session["username"] != null && Session["category"] != null && Session["operator_id"] != null)
            {
                string username = Convert.ToString(Session["username"]);
                string operid   = Session["operator_id"].ToString();
                string catid    = Session["category"].ToString();

                Cls_Business_MstLCORegistration obj = new Cls_Business_MstLCORegistration();
                DataSet dsCompData = obj.getCompDataBll(username, catid, operid, ViewState["companyname"].ToString());
                if (dsCompData != null)
                {
                    ddlCompany.DataSource     = dsCompData.Tables[0];
                    ddlCompany.DataTextField  = "COMP_NAME";
                    ddlCompany.DataValueField = "COMP_ID";
                    ddlCompany.DataBind();
                    //ddlCompany.Items.Insert(0, new ListItem("Select Company", "0"));

                    //ddlDist.DataSource = dsCompData.Tables[1];
                    //ddlDist.DataTextField = "DIST_NAME";
                    //ddlDist.DataValueField = "DIST_ID";
                    //ddlDist.DataBind();
                    //ddlDist.Items.Insert(0, new ListItem("Select Distributor", "0"));

                    //ddlSubDist.DataSource = dsCompData.Tables[2];
                    //ddlSubDist.DataTextField = "SUBDIST_NAME";
                    //ddlSubDist.DataValueField = "SUBDIST_ID";
                    //ddlSubDist.DataBind();
                    //ddlSubDist.Items.Insert(0, new ListItem("Select Subdistributor", "0"));

                    //ddlMSO.DataSource = dsCompData.Tables[3];
                    //ddlMSO.DataTextField = "var_oper_opername";
                    //ddlMSO.DataValueField = "num_oper_id";
                    //ddlMSO.DataBind();
                    //ddlMSO.Items.Insert(0,new ListItem("Select MSO", "0"));

                    //ddlDistributor.DataSource = dsCompData.Tables[4];
                    //ddlDistributor.DataTextField = "var_oper_opername";
                    //ddlDistributor.DataValueField = "num_oper_id";
                    //ddlDistributor.DataBind();
                    //ddlDistributor.Items.Insert(0, new ListItem("Select Distributor", "0"));
                }
                else
                {
                    //exception occured
                    Response.Redirect("~/ErrorPage.aspx");
                    return;
                }
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
            }
        }
示例#2
0
        protected void loadLCOSection()
        {
            Hashtable htLCOParams = getLCOParamsData();

            if (Session["username"] != null && Session["operator_id"] != null)
            {
                string username    = Convert.ToString(Session["username"]);
                string catid       = Convert.ToString(Session["category"]);
                string operator_id = Convert.ToString(Session["operator_id"]);
                Cls_Business_MstLCORegistration obj = new Cls_Business_MstLCORegistration();
                Hashtable htResponse = obj.GetTransations(htLCOParams, username);


                OracleConnection conn = new OracleConnection(ConfigurationSettings.AppSettings["ConString"].ToString().Trim());
                DataTable        dts  = new DataTable();
                try
                {
                    conn.Open();
                    string StrQry;
                    StrQry = " Select a.var_lcomst_ecsstatus from aoup_lcopre_lco_det a ";

                    if (RadSearchby.SelectedValue.ToString() == "0")
                    {
                        StrQry += " where upper(a.var_lcomst_code)  like upper('" + txtLCOSearch.Text + "%') ";
                    }
                    else if (RadSearchby.SelectedValue.ToString() == "1")
                    {
                        StrQry += " where upper(a.var_lcomst_name) like upper('" + txtLCOSearch.Text + "%') ";
                    }

                    OracleDataAdapter da = new OracleDataAdapter(StrQry, conn);
                    da.Fill(dts);
                    if (conn.State != ConnectionState.Closed)
                    {
                        conn.Close();
                    }
                }
                catch (Exception ex)
                {
                }
                DataTable dt = null; //check for exception
                if (htResponse["htResponse"] != null)
                {
                    dt = (DataTable)htResponse["htResponse"];
                }

                if (dt == null)
                {
                    Response.Redirect("~/ErrorPage.aspx");
                    return;
                }

                if (dt.Rows.Count == 0)
                {
                    lblResponseMsg.Text = "No data found...";
                    divdetails.Visible  = false;
                }
                else
                {
                    divdetails.Visible = true;
                    lblLcoCode.Text    = dt.Rows[0]["var_hway_lco_code"].ToString();
                    lblLcoName.Text    = dt.Rows[0]["var_hway_lco_name"].ToString();
                    txtFirstName.Text  = dt.Rows[0]["var_hway_first_name"].ToString();
                    txtMidName.Text    = dt.Rows[0]["var_hway_middle_name"].ToString();
                    txtLastName.Text   = dt.Rows[0]["var_hway_last_name"].ToString();
                    txtDirect.Text     = dt.Rows[0]["var_hway_dt"].ToString();
                    txtJV.Text         = dt.Rows[0]["var_hway_jv"].ToString();
                    txtDist.Text       = dt.Rows[0]["var_hway_dt"].ToString();
                    txtSubDist.Text    = dt.Rows[0]["var_hway_sdt"].ToString();
                    txtBrmId.Text      = dt.Rows[0]["var_hway_brm_poid"].ToString();
                    txtAddress.Text    = dt.Rows[0]["var_hway_address"].ToString();
                    ViewState["state"] = dt.Rows[0]["var_hway_state"].ToString();
                    ViewState["city"]  = dt.Rows[0]["var_hway_city"].ToString();
                    Session["fetched_mstlcoreg_city"] = dt.Rows[0]["var_hway_city"].ToString();
                    ViewState["companyname"]          = dt.Rows[0]["var_hway_company"].ToString();
                    loadState();
                    loadCity();
                    loadCompanySection();
                    txtPincode.Text     = dt.Rows[0]["var_hway_zipcode"].ToString();
                    txtUsername.Text    = "";
                    txtMobile.Text      = dt.Rows[0]["var_hway_phone"].ToString();
                    txtEmail.Text       = dt.Rows[0]["var_hway_email"].ToString();
                    lblResponseMsg.Text = "";
                    if (dts.Rows.Count != 0)
                    {
                        if (dts.Rows[0]["var_lcomst_ecsstatus"].ToString() == "Y")
                        {
                            chkecsstatus.Checked = true;
                        }
                    }
                }
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
            }
        }
示例#3
0
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            Hashtable ht   = new Hashtable();
            string    code = lblLcoCode.Text;

            ht["code"] = code;
            string name = lblLcoName.Text;

            ht["name"] = name;
            string fname = txtFirstName.Text;

            ht["fname"] = fname;
            string mname = txtMidName.Text;

            ht["mname"] = mname;
            string lname = txtLastName.Text;

            ht["lname"] = lname;
            string jv     = "0";
            string direct = "0";

            jv = txtJV.Text;


            direct = txtDirect.Text;

            ht["jv"]     = jv;
            ht["direct"] = direct;
            string company = ddlCompany.SelectedValue.ToString();

            ht["company"] = company;

            string distributor = txtDist.Text.ToString();

            ht["distributor"] = distributor;

            string subdistributor = txtSubDist.Text.ToString();

            ht["subdistributor"] = subdistributor;
            string userid = "";//txtUserId.Text;

            ht["userid"] = userid;
            string brmpoid = txtBrmId.Text;

            ht["brmpoid"] = brmpoid;

            ht["LcoUserName"] = txtUsername.Text;
            string addr = txtAddress.Text;

            ht["addr"] = addr;
            string state = ddlState.SelectedValue.ToString();

            ht["state"] = state;
            string city = ddlCity.SelectedValue.ToString();

            ht["city"] = city;
            string pin = txtPincode.Text;

            ht["pin"] = pin;
            string mobile = txtMobile.Text;

            ht["mobile"] = mobile;
            string email = txtEmail.Text;

            ht["email"] = email;


            if (ViewState["lcoid"] != null)
            {
                ht["lcoid"] = Convert.ToString(ViewState["lcoid"]);
            }
            else
            {
                ht["lcoid"] = "0";
            }

            if (ViewState["flag"] != null)
            {
                ht["flag"] = Convert.ToString(ViewState["flag"]);
            }
            else
            {
                ht["flag"] = "0";
            }

            Cls_Business_MstLCORegistration obj = new Cls_Business_MstLCORegistration();
            string username = "";
            string compcode = "";

            if (Session["username"] != null)
            {
                username = Convert.ToString(Session["username"]);
                compcode = Convert.ToString(Session["opr_code"]);
            }
            else
            {
                Session.Abandon();
                Response.Redirect("~/Login.aspx");
            }
            ht["compcode"] = compcode;
            //ht["MSO"] = ddlMSO.SelectedValue.ToString();
            //ht["Distributor"] = ddlDistributor.SelectedValue.ToString();
            if (chkecsstatus.Checked == true)
            {
                ht["ecssattus"] = "Y";
            }
            else
            {
                ht["ecssattus"] = "N";
            }
            string response = obj.setLCOData(username, ht);

            reset();
            if (response == "ex_occured")
            {
                //exception occured
                Response.Redirect("~/ErrorPage.aspx");
                return;
            }
            else
            {
                lblResponseMsg.Text = response;
            }
        }