protected void bt_Add_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["PriceID"] > 0)
        {
            if (tr_OrganizeCity.SelectValue != "0" && tr_OrganizeCity.SelectValue != tr_OrganizeCity.RootValue)
            {
                PDT_StandardPriceBLL bll = new PDT_StandardPriceBLL((int)ViewState["PriceID"]);

                Addr_OrganizeCityBLL selectedcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
                string[] allparent = selectedcity.GetAllSuperNodeIDs().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (PDT_StandardPrice_ApplyCity city in bll.ApplyCityItems)
                {
                    if (selectedcity.Model.ID == city.OrganizeCity)
                    {
                        MessageBox.Show(this, "对不起,该区域已在适用区域内,请勿重复添加!");
                        return;
                    }

                    if (allparent.Contains(city.OrganizeCity.ToString()))
                    {
                        MessageBox.Show(this, "对不起,要新增的区域的上级【" + TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", city.OrganizeCity) + "】已在适用区域内!");
                        return;
                    }
                }

                PDT_StandardPrice_ApplyCity c = new PDT_StandardPrice_ApplyCity();
                c.OrganizeCity = int.Parse(tr_OrganizeCity.SelectValue);
                bll.AddApplyCity(c);

                BindCheckBoxList();
            }
        }
    }
Пример #2
0
    protected void bt_Add_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["Insurance"] > 0)
        {
            if (tr_OrganizeCity.SelectValue != "0" && tr_OrganizeCity.SelectValue != tr_OrganizeCity.RootValue)
            {
                PM_StdInsuranceCostBLL bll = new PM_StdInsuranceCostBLL((int)ViewState["Insurance"]);

                Addr_OrganizeCityBLL selectedcity     = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
                string[]             allparent        = selectedcity.GetAllSuperNodeIDs().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                IList <PM_StdInsuranceCostInCity> pms = PM_StdInsuranceCostInCityBLL.GetModelList("Insurance=" + (int)ViewState["Insurance"]);
                foreach (PM_StdInsuranceCostInCity p in pms)
                {
                    if (selectedcity.Model.ID == p.City)
                    {
                        MessageBox.Show(this, "对不起,该区域已在适用区域内,请勿重复添加!");
                        return;
                    }

                    if (allparent.Contains(p.City.ToString()))
                    {
                        MessageBox.Show(this, "对不起,要新增的区域的上级【" + TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", p.City) + "】已在适用区域内!");
                        return;
                    }
                }

                PM_StdInsuranceCostInCityBLL c = new PM_StdInsuranceCostInCityBLL();
                c.Model.City        = int.Parse(tr_OrganizeCity.SelectValue);
                c.Model.Insurance   = bll.Model.ID;
                c.Model.InsertStaff = (int)Session["UserID"];
                c.Model.InsertTime  = DateTime.Now;
                c.Add();

                BindCheckBoxList();
            }
        }
    }
    protected void bt_Add_Click(object sender, EventArgs e)
    {
        if ((int)ViewState["Insurance"] > 0)
        {
            if (tr_OrganizeCity.SelectValue != "0" && tr_OrganizeCity.SelectValue != tr_OrganizeCity.RootValue)
            {
                PM_StdInsuranceCostBLL bll = new PM_StdInsuranceCostBLL((int)ViewState["Insurance"]);

                Addr_OrganizeCityBLL selectedcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
                string[] allparent = selectedcity.GetAllSuperNodeIDs().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                IList<PM_StdInsuranceCostInCity> pms = PM_StdInsuranceCostInCityBLL.GetModelList("Insurance=" + (int)ViewState["Insurance"]);
                foreach (PM_StdInsuranceCostInCity p in pms)
                {
                    if (selectedcity.Model.ID == p.City)
                    {
                        MessageBox.Show(this, "对不起,该区域已在适用区域内,请勿重复添加!");
                        return;
                    }

                    if (allparent.Contains(p.City.ToString()))
                    {
                        MessageBox.Show(this, "对不起,要新增的区域的上级【" + TreeTableBLL.GetFullPathName("MCS_SYS.dbo.Addr_OrganizeCity", p.City) + "】已在适用区域内!");
                        return;
                    }
                }

                PM_StdInsuranceCostInCityBLL c = new PM_StdInsuranceCostInCityBLL();
                c.Model.City = int.Parse(tr_OrganizeCity.SelectValue);
                c.Model.Insurance = bll.Model.ID;
                c.Model.InsertStaff = (int)Session["UserID"];
                c.Model.InsertTime = DateTime.Now;
                c.Add();

                BindCheckBoxList();
            }
        }
    }
 protected void select_Client_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
 {
     tr_OrganizeCity.SelectValue = new CM_ClientBLL(int.Parse(select_Client.SelectValue)).Model.OrganizeCity.ToString();
     Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));
     ddl_StandardPrice.DataSource = PDT_StandardPriceBLL.GetModelList("ActiveFlag=1 AND ApproveFlag=1 AND ID IN (SELECT StandardPrice FROM PDT_StandardPrice_ApplyCity WHERE OrganizeCity IN (" + orgcity.GetAllSuperNodeIDs() + "," + tr_OrganizeCity.SelectValue + ")) ");
     ddl_StandardPrice.DataBind();
     ddl_StandardPrice.Items.Insert(0, new ListItem("请选择....", "0"));
     ddl_StandardPrice.SelectedValue = "0";
 }
Пример #5
0
    protected void select_Client_SelectChange(object sender, MCSControls.MCSWebControls.SelectChangeEventArgs e)
    {
        tr_OrganizeCity.SelectValue = new CM_ClientBLL(int.Parse(select_Client.SelectValue)).Model.OrganizeCity.ToString();
        Addr_OrganizeCityBLL orgcity = new Addr_OrganizeCityBLL(int.Parse(tr_OrganizeCity.SelectValue));

        ddl_StandardPrice.DataSource = PDT_StandardPriceBLL.GetModelList("ActiveFlag=1 AND ApproveFlag=1 AND ID IN (SELECT StandardPrice FROM PDT_StandardPrice_ApplyCity WHERE OrganizeCity IN (" + orgcity.GetAllSuperNodeIDs() + "," + tr_OrganizeCity.SelectValue + ")) ");
        ddl_StandardPrice.DataBind();
        ddl_StandardPrice.Items.Insert(0, new ListItem("请选择....", "0"));
        ddl_StandardPrice.SelectedValue = "0";
    }