/// <summary>
        /// this is a overloaded method of 'loadSubBusinessEntity' to refresh the drop downl list
        /// </summary>
        /// <param name="sub"></param>
        protected void loadSubBusinessEntity(subBusinessEntity sub)
        {
            ListItem ltSub = new ListItem();

            ltSub.Text  = sub.getSubEntityName();
            ltSub.Value = sub.getSubEntityId();
            DropDownList1.Items.Add(ltSub);
        }
        protected void ButtonNext_Click(object sender, EventArgs e)
        {
            subBusinessEntity   subBE  = createSubBusinessEntity();
            RegistrationActions regStr = new RegistrationActions();

            ArrayList regList = new ArrayList();

            regList.Add(subBE);
            regStr.completeRegr(regList);
            loadSubBusinessEntity(subBE);
            clearAllFields("Panel2");
        }
Пример #3
0
        protected void populateGrid()
        {
            Dictionary <String, subBusinessEntity> subEntDict = BackEndObjects.MainBusinessEntity.
                                                                getSubEntitiesforMainEntitybyIdDB(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());

            DataTable dt = new DataTable();

            dt.Columns.Add("ChainName");
            dt.Columns.Add("ContactNo");
            dt.Columns.Add("ContactName");
            dt.Columns.Add("EmailId");
            dt.Columns.Add("WebSite");
            dt.Columns.Add("RegstrNo");
            dt.Columns.Add("BaseCurr");
            dt.Columns.Add("ChainId");

            int counter = 0;

            foreach (KeyValuePair <String, subBusinessEntity> kvp in subEntDict)
            {
                subBusinessEntity subEntObj = (subBusinessEntity)kvp.Value;
                dt.Rows.Add();

                dt.Rows[counter]["ChainName"]   = subEntObj.getSubEntityName();
                dt.Rows[counter]["ContactNo"]   = subEntObj.getSubPhNo();
                dt.Rows[counter]["ContactName"] = subEntObj.getContactName();
                dt.Rows[counter]["EmailId"]     = subEntObj.getSubEmailId();
                dt.Rows[counter]["WebSite"]     = subEntObj.getSubWebSite();
                dt.Rows[counter]["RegstrNo"]    = subEntObj.getSubRegstrNo();
                dt.Rows[counter]["BaseCurr"]    = BackEndObjects.Currency.getCurrencybyIdDB(subEntObj.getBaseCurrencyId()).getCurrencyName();
                dt.Rows[counter]["ChainId"]     = subEntObj.getSubEntityId();
                //dt.Rows[counter]["dlList"] = dl;
                counter++;
            }

            GridView1.DataSource = dt;
            GridView1.DataBind();
            GridView1.Columns[10].Visible = false;


            Session[SessionFactory.ADMIN_PREF_CHAIN_MGMT_DATA_GRID] = dt;
        }
        protected subBusinessEntity createSubBusinessEntity()
        {
            subBusinessEntity subBE = new subBusinessEntity();

            subBE.setMainBusinessId(Session[SessionFactory.MAIN_BUSINESS_ENTITY_ID_STRING].ToString());
            subBE.setSubEntityName(TextBox6.Text);
            subBE.setSubRegstrNo(TextBox7.Text);
            subBE.setContactName(TextBox10.Text);
            subBE.setSubPhNo(TextBox11.Text);
            subBE.setSubEmailId(TextBox12.Text);
            subBE.setSubWebSite(TextBox13.Text);
            subBE.setBaseCurrencyId(DropDownListBaseCurr.SelectedValue);
            subBE.setLocalityId(DropDownList5.SelectedValue);
            subBE.setAddrLine1(TextBox8.Text);

            Id     idGen   = new Id();
            String subBEId = idGen.getNewId(Id.ID_TYPE_SUB_BUS_STRING);

            subBE.setSubEntityId(subBEId);

            return(subBE);
        }
        /// <summary>
        /// Completes the registration for the sub business entity
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Button1_Click(object sender, EventArgs e)
        {
            subBusinessEntity   subBE  = createSubBusinessEntity();
            RegistrationActions regStr = new RegistrationActions();

            ArrayList regList = new ArrayList();

            regList.Add(subBE);
            try
            {
                regStr.completeRegr(regList);
                Label1.Visible   = true;
                Label1.ForeColor = System.Drawing.Color.Green;
                Label1.Text      = "Data created successfully";
                loadSubBusinessEntity(subBE);
            }
            catch (Exception ex)
            {
                Label1.Visible   = true;
                Label1.ForeColor = System.Drawing.Color.Red;
                Label1.Text      = "Error in creating data";
            }
        }