Exemplo n.º 1
0
        public ActionResult DDCustomer(int ClientId)
        {
            List <DDCustomers_get_Result> dDCustomers = new List <DDCustomers_get_Result>();

            if (Session["ProfileId"] != null)
            {
                if (Convert.ToString(Session["ProfileId"]) == "1" || Convert.ToString(Session["ProfileId"]) == "2")
                {
                    using (SecurityDBEntities entities = new SecurityDBEntities())
                    {
                        dDCustomers = entities.DDCustomers_get(ClientId).ToList();
                    }
                }
                else
                {
                    string[] CustName = Convert.ToString(Session["CustMapping"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    string[] CustId   = Convert.ToString(Session["CustId"]).Split(new string[] { "||" }, StringSplitOptions.None);
                    DDCustomers_get_Result dDCustomers_Get_ = new DDCustomers_get_Result();
                    for (int i = 0; i < CustName.Length; i++)
                    {
                        dDCustomers_Get_.CustName = CustName[i].ToString();
                    }
                    for (int i = 0; i < CustId.Length; i++)
                    {
                        dDCustomers_Get_.CustId = Convert.ToInt32(CustId[i]);
                    }
                    dDCustomers.Add(dDCustomers_Get_);
                }
            }
            return(Json(dDCustomers));
        }