private void FillCustomerDeatilGrid()
        {
            try
            {
                iUserCreationClient userClient = new iUserCreationClient();
                CustomProfile       profile    = CustomProfile.GetProfile();
                //GvAccount.DataSource = AccountClient.GetGetCustomerDetail(profile.Personal.UserID,profile.DBConnection._constr);//UserID added by vishal old
                GvAccount.DataSource = userClient.GWCSearchUserList(CompanyID, DeptId, profile.DBConnection._constr);

                //Change by Suresh For GCC Admin Invoiceing
                iCompanySetupClient Cmpny = new iCompanySetupClient();
                // GvAccount.DataSource = Cmpny.GetInstituteDetails(profile.DBConnection._constr);

                if (GvAccount.DataSource != null)
                {
                    GvAccount.DataBind();
                }
                userClient.Close();
            }
            catch (System.Exception ex)
            {
                // Login.Profile.ErrorHandling(ex, this, "AccountSearch.aspx", "FillCustomerDeatilGrid");
            }
            finally
            {
            }
        }
        public void fillEngine()
        {
            ChartProperty       objclsChartProperty = new ChartProperty();
            iUserCreationClient UserCreationClient  = new iUserCreationClient();
            CustomProfile       profile             = CustomProfile.GetProfile();

            str = hfCount.Value;

            if (ddlSite.SelectedIndex == 0)
            {
                eng = str;
            }
            else
            {
                eng = str;
            }

            string p = eng;
            iEngineMasterClient    EngineClient    = new iEngineMasterClient();
            iProductMasterClient   productClient   = new iProductMasterClient();
            iPartRequisitionClient RequsitonClient = new iPartRequisitionClient();

            if (p != "")
            {
                chkEngineList.DataSource = EngineClient.GetEngineOfSite(p, profile.DBConnection._constr);
                chkEngineList.DataBind();
            }
        }
示例#3
0
        public void BindAccessDelgrid(string state, long UserId)
        {
            DataTable           dt         = new DataTable();
            DataSet             ds         = new DataSet();
            CustomProfile       profile    = CustomProfile.GetProfile();
            iUserCreationClient userClient = new iUserCreationClient();

            try
            {
                ds = userClient.GetUserDelegationDetail(state, UserId, profile.DBConnection._constr);
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    grdaccessdele.DataSource = ds.Tables[0];
                    grdaccessdele.DataBind();
                }
                else
                {
                    grdaccessdele.DataSource = null;
                    grdaccessdele.DataBind();
                }
            }
            catch (Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Access Delegation", "BindAccessDelgrid");
            }
            finally { userClient.Close(); }
        }
 public static string PMSaveChangePassword(string loginname, string currentpassword, string newpassword)
 {
     try
     {
         CustomProfile       profile    = CustomProfile.GetProfile();
         iUserCreationClient userClient = new iUserCreationClient();
         MembershipUser      u          = Membership.GetUser(loginname);
         if (u.IsLockedOut == true)
         {
             u.UnlockUser();
         }
         if (u.ChangePassword(currentpassword, newpassword) == true)
         {
             string Email = profile.Personal.EmailID;
             userClient.SavePasswordDetails(profile.Personal.UserID, Email, loginname, newpassword, profile.Personal.UserName, profile.DBConnection._constr);
             return("Saved");
         }
         else
         {
             return("");
         }
     }
     catch (Exception ex) { return(""); }
     finally { }
 }
示例#5
0
        public void BindDepartment(long UserID, string usertype)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();
            DataSet             ds;

            try
            {
                if (usertype != "Super Admin")
                {
                    ds = userClient.GetDepartmentDelegate(UserID, profile.DBConnection._constr);
                }
                else
                {
                    ds = userClient.GetDepartmentSSuperAdmin(profile.DBConnection._constr);
                }
                ddlDepartment.DataSource     = ds;
                ddlDepartment.DataTextField  = "Territory";
                ddlDepartment.DataValueField = "ID";
                ddlDepartment.DataBind();
                ListItem lst = new ListItem {
                    Text = "-Select-", Value = "0"
                };
                ddlDepartment.Items.Insert(0, lst);
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Access Delegation", "BindDepartment");
            }
            finally { userClient.Close(); }
        }
        public static string PMCheckPassword(string ConfirmPassword)
        {
            CustomProfile       profile    = CustomProfile.GetProfile();
            iUserCreationClient userClient = new iUserCreationClient();
            DataSet             ds         = new DataSet();
            string str = "";

            try
            {
                ds = userClient.CheckPasswordHistory(profile.Personal.UserID, ConfirmPassword, profile.DBConnection._constr);
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    if (ds.Tables[0].Rows[i]["Password"].ToString() == ConfirmPassword)
                    {
                        str = "PasswordFound";
                    }
                }

                if (str == "")
                {
                    string OneDayValidation = userClient.CheckOneDayValidation(profile.Personal.UserID, profile.DBConnection._constr);
                    str = OneDayValidation;
                }
            }
            catch (Exception ex) {}
            finally { }
            return(str);
        }
示例#7
0
        public void fillProduct()
        {
            ChartProperty objclsChartProperty = new ChartProperty();

            objclsChartProperty.QueryParameter = "";
            iUserCreationClient UserCreationClient = new iUserCreationClient();
            CustomProfile       profile            = CustomProfile.GetProfile();

            string abc = hfEng.Value;

            str = hfCount.Value;


            if (ddlSite.SelectedIndex == 0)
            {
                eng = str;
            }
            else
            {
                eng = str;
            }

            string p = eng;

            for (int y = 0; y <= chkEngineList.Items.Count - 1; y++)
            {
                if (prd == null)
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        prd = prd + chkEngineList.Items[y].Value;
                    }
                }
                else
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        prd = prd + "," + chkEngineList.Items[y].Value;
                    }
                }
            }
            string q = prd;

            string fdt = frmdate.Date.Value.ToString("yyyy-MM-dd");
            string tdt = todate.Date.Value.ToString("yyyy-MM-dd");

            iEngineMasterClient  EngineClient  = new iEngineMasterClient();
            iProductMasterClient productClient = new iProductMasterClient();

            //iPartRequisitionClient RequsitonClient = new iPartRequisitionClient();

            if (q != null)
            {
                chkProductLst.DataSource = productClient.GetProductofEngine(fdt, tdt, p, q, profile.DBConnection._constr);
                chkProductLst.DataBind();
            }
        }
        protected void QueryBind()
        {
            ChartProperty objclsChartProperty = new ChartProperty();

            objclsChartProperty.ConnectionString = sqlConn.ToString();
            iUserCreationClient UserCreationClient = new iUserCreationClient();
            CustomProfile       profile            = CustomProfile.GetProfile();

            str = hfCount.Value;
            if (ddlSite.SelectedIndex == 0)
            {
                sit = str;
            }
            else
            {
                sit = str;
            }

            for (int y = 0; y <= chkEngineList.Items.Count - 1; y++)
            {
                if (eng == null)
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        eng = eng + chkEngineList.Items[y].Value;
                    }
                }
                else
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        eng = eng + "," + chkEngineList.Items[y].Value;
                    }
                }
            }

            for (int z = 0; z <= chkProductLst.Items.Count - 1; z++)
            {
                if (prd == null)
                {
                    if (chkProductLst.Items[z].Selected == true)
                    {
                        prd = prd + chkProductLst.Items[z].Value;
                    }
                }
                else
                {
                    if (chkProductLst.Items[z].Selected == true)
                    {
                        prd = prd + "," + chkProductLst.Items[z].Value;
                    }
                }
            }

            string frmd = FrmDate.Date.Value.ToString("yyyy-MM-dd");
            string tod  = ToDate.Date.Value.ToString("yyyy-MM-dd");
        }
        public void FillUserType()
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();

            ddlUserType.DataSource = userClient.GetUserType(profile.DBConnection._constr);
            ddlUserType.DataBind();
            ListItem lst = new ListItem();

            lst.Text  = "--Select--";
            lst.Value = "0";
            ddlUserType.Items.Insert(0, lst);
        }
示例#10
0
        public static List <contact> Getdelegate(object objReq)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();
            DataSet             ds         = new DataSet();
            DataTable           dt         = new DataTable();
            List <contact>      LocList    = new List <contact>();

            try
            {
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReq;
                //ds = ReceivableClient.GetProdLocations(ProdCode.Trim());
                long ddlDepartment = long.Parse(dictionary["ddlDepartment"].ToString());
                long UsrId         = long.Parse(profile.Personal.UserID.ToString());
                ds = userClient.getDelegateToList(ddlDepartment, UsrId, profile.DBConnection._constr);

                dt = ds.Tables[0];


                contact Loc = new contact();
                Loc.Name = "--Select--";
                Loc.Id   = "0";
                LocList.Add(Loc);
                Loc = new contact();

                if (dt.Rows.Count > 0)
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        Loc.Id   = dt.Rows[i]["ID"].ToString();
                        Loc.Name = dt.Rows[i]["Name"].ToString();
                        LocList.Add(Loc);
                        Loc = new contact();
                    }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Access Delegation", "Getdelegate");
            }
            finally
            {
                userClient.Close();
            }
            return(LocList);
        }
        public void fillSite()
        {
            string sid;
            iUserCreationClient UserCreationClient = new iUserCreationClient();
            CustomProfile       profile            = CustomProfile.GetProfile();

            sid = UserCreationClient.GetTerritoryID_FromUserId(profile.Personal.UserID, profile.DBConnection._constr);

            ddlSite.DataSource = UserCreationClient.GetSiteNameFromId(sid, profile.DBConnection._constr);
            ddlSite.DataBind();

            ListItem lst1 = new ListItem();

            lst1.Text  = "Select All";
            lst1.Value = "0";
            ddlSite.Items.Insert(0, lst1);
        }
示例#12
0
        public static void PMSaveLocation(string selectedIds, long userid)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();
            string ids = selectedIds.ToString();

            string[] words = ids.Split(',');
            for (int i = 1; i < words.Length; i++)
            {
                long locationid = long.Parse(words[i]);
                long count      = userClient.GetDuplicatlocationUser(userid, locationid, profile.DBConnection._constr);
                if (count <= 0)
                {
                    userClient.InsertIntoUserLocation(userid, locationid, profile.DBConnection._constr);
                }
            }
        }
示例#13
0
        public void GetDelegationDetail(long Delegateid)
        {
            iUserCreationClient userClient = new iUserCreationClient();
            CustomProfile       profile    = CustomProfile.GetProfile();

            try
            {
                DataSet   ds;
                DataTable dt;
                //ds = productClient.GetBOMDetailById(BOMDetailId, profile.DBConnection._constr);
                ds = userClient.getUserDelegateDetail(Delegateid, profile.DBConnection._constr);
                dt = ds.Tables[0];
                if (dt.Rows.Count > 0)
                {
                    long deptId = long.Parse(dt.Rows[0]["DeptID"].ToString());
                    BindDepartment(UserID, UserType);
                    ddlDepartment.SelectedIndex = ddlDepartment.Items.IndexOf(ddlDepartment.Items.FindByValue(dt.Rows[0]["DeptID"].ToString()));
                    getDelegateToList(deptId);
                    if (ddlUOM.Items.Count >= 1)
                    {
                        ddlUOM.SelectedIndex = 0;
                    }
                    ddlUOM.SelectedIndex      = ddlUOM.Items.IndexOf(ddlUOM.Items.FindByValue(dt.Rows[0]["DeligateTo"].ToString()));
                    ddlUOM.SelectedItem.Value = dt.Rows[0]["DeligateTo"].ToString();
                    //ddlUOM.SelectedItem.Text = dt.Rows[0]["Name"].ToString();

                    hdndegateId.Value = Delegateid.ToString();

                    txtPrincipalPrice.Text     = dt.Rows[0]["Remark"].ToString();
                    UC_Date1.Date              = Convert.ToDateTime(dt.Rows[0]["FromDate"].ToString());
                    UC_Date2.Date              = Convert.ToDateTime(dt.Rows[0]["ToDate"].ToString());
                    hdndeligateeditstate.Value = "Edit";
                    hdnnewDelegateid.Value     = dt.Rows[0]["ID"].ToString();
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, this, "Access Delegation", "GetDelegationDetail");
            }
            finally
            {
                userClient.Close();
            }
        }
示例#14
0
        //protected void grdaccessdele_Select(object sender, Obout.Grid.GridRecordEventArgs e)
        //{
        //    try
        //    {
        //        Hashtable selectedrec = (Hashtable)grdaccessdele.SelectedRecords[0];
        //        hdndegateId.Value = selectedrec["ID"].ToString();

        //        hdnnewDelegateid.Value = selectedrec["ID"].ToString();
        //        hdndeligateeditstate.Value = "Edit";
        //        GetDelegationDetail(long.Parse(hdndegateId.Value));
        //        //string editsession = "Edit";

        //        Session["hdnedit"] = "Edit";
        //        Session.Add("hdnnewDelegateid", hdnnewDelegateid.Value);
        //    }
        //    catch (Exception ex)
        //    {
        //        Login.Profile.ErrorHandling(ex, this, "Access Delegation", "BindAccessDelgrid");
        //    }
        //    finally {}
        //}

        //protected void imgBtnEditbom_OnClick(object sender, ImageClickEventArgs e)
        //{
        //    ImageButton imgbtn = (ImageButton)sender;
        //    hdnnewDelegateid.Value = imgbtn.ToolTip.ToString();
        //    hdndegateId.Value = imgbtn.ToolTip.ToString();
        //    hdndeligateeditstate.Value = "Edit";
        //    GetDelegationDetail(long.Parse(hdndegateId.Value));
        //    //string editsession = "Edit";

        //    Session["hdnedit"] = "Edit";
        //    Session.Add("hdnnewDelegateid", hdnnewDelegateid.Value);
        //}

        public void getDelegateToList(long DeptId)
        {
            CustomProfile       profile    = CustomProfile.GetProfile();
            iUserCreationClient userClient = new iUserCreationClient();
            long    UserID = long.Parse(profile.Personal.UserID.ToString());
            DataSet ds;

            ds = userClient.getDelegateToList(DeptId, UserID, profile.DBConnection._constr);
            // ds = userClient.getDelegateToListMultipleDept(hdnSelectedLocation.Value, profile.DBConnection._constr);
            ddlUOM.DataSource     = ds;
            ddlUOM.DataTextField  = "Name";
            ddlUOM.DataValueField = "ID";
            ddlUOM.DataBind();
            ListItem lst = new ListItem {
                Text = "-Select-", Value = "0"
            };

            ddlUOM.Items.Insert(0, lst);
        }
示例#15
0
        public static string RemoveSku(object objReq)
        {
            string result = "";
            iUserCreationClient userClient = new iUserCreationClient();

            try{
                CustomProfile profile = CustomProfile.GetProfile();
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReq;
                long Delegateid = long.Parse(dictionary["Delegateid"].ToString());
                userClient.Deletedelegate(Delegateid, profile.DBConnection._constr);
                result = "success";
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Access Delegation", "RemoveSku");
            }
            finally
            {
                userClient.Close();
            }
            return(result);
        }
示例#16
0
        public static string SaveAccessDelegation(object objReq)
        {
            string result = "";
            iUserCreationClient userClient = new iUserCreationClient();

            try
            {
                string hiddneedit = "";

                CustomProfile profile = CustomProfile.GetProfile();
                Dictionary <string, object> dictionary = new Dictionary <string, object>();
                dictionary = (Dictionary <string, object>)objReq;
                long     department = long.Parse(dictionary["department"].ToString());
                long     Delegateto = long.Parse(dictionary["Delegateto"].ToString());
                string   Remark     = dictionary["Remark"].ToString();
                string   hndstate   = dictionary["hndstate"].ToString();
                long     UserId     = long.Parse(dictionary["UserId"].ToString());
                DateTime FromDate   = Convert.ToDateTime(dictionary["FromDate"].ToString());
                DateTime ToDate     = Convert.ToDateTime(dictionary["ToDate"].ToString());
                // long newdelegate = long.Parse(dictionary["newDelegate"].ToString());
                long DelegateId   = 0;
                long delegatefrom = UserId;



                if (HttpContext.Current.Session["hdnedit"].ToString() != "" || HttpContext.Current.Session["hdnedit"].ToString() != null)
                {
                    hndstate = HttpContext.Current.Session["hdnedit"].ToString();
                }

                string hdndelegatestateedit = dictionary["hdndeligateeditstate"].ToString();
                if (hndstate == "Edit")
                {
                    string hdndeligateeditstate = hiddneedit.ToString();
                    hndstate = hdndeligateeditstate.ToString();
                    string delid = HttpContext.Current.Session["hdnnewDelegateid"].ToString();
                    DelegateId = long.Parse(delid.ToString());
                    HttpContext.Current.Session["hdnnewDelegateid"] = "";
                    HttpContext.Current.Session["hdnedit"]          = "";
                    userClient.SaveEditUserDelegation(DelegateId, delegatefrom, FromDate, ToDate, Delegateto, Remark, hndstate, profile.Personal.UserID, DateTime.Now, department, profile.DBConnection._constr);
                }
                else
                {
                    long valuecount = 0;
                    valuecount = userClient.GetDuplicateDelegate(FromDate, ToDate, Delegateto, department, delegatefrom, profile.DBConnection._constr);
                    if (valuecount == 0)
                    {
                        string hdndeligateeditstate = hiddneedit.ToString();
                        hndstate = hdndeligateeditstate.ToString();
                        hndstate = "Add";
                        //string delid = HttpContext.Current.Session["hdnnewDelegateid"].ToString();
                        // DelegateId = long.Parse(delid.ToString());
                        HttpContext.Current.Session["hdnnewDelegateid"] = "";
                        HttpContext.Current.Session["hdnedit"]          = "";
                        userClient.SaveEditUserDelegation(DelegateId, delegatefrom, FromDate, ToDate, Delegateto, Remark, hndstate, profile.Personal.UserID, DateTime.Now, department, profile.DBConnection._constr);
                    }
                    else
                    {
                        result = "Exist";
                    }
                }
            }
            catch (System.Exception ex)
            {
                Login.Profile.ErrorHandling(ex, "Access Delegation", "SaveAccessDelegation");
            }
            finally
            {
                userClient.Close();
            }

            return(result);
        }
示例#17
0
        private void ChartBind()
        {
            ChartProperty objclsChartProperty = new ChartProperty();

            objclsChartProperty.ConnectionString = sqlConn.ToString();
            objclsChartProperty.ReportID         = 48;
            objclsChartProperty.QueryParameter   = "";

            iUserCreationClient UserCreationClient = new iUserCreationClient();
            CustomProfile       profile            = CustomProfile.GetProfile();

            str = hfCount.Value;
            //if (ddlSite.SelectedIndex == 0) { sit = UserCreationClient.GetTerritoryID_FromUserId(profile.Personal.UserID, profile.DBConnection._constr); }
            //else { sit = Convert.ToString(ddlSite.SelectedValue); }

            if (ddlSite.SelectedIndex == 0)
            {
                sit = str;
            }
            else
            {
                sit = str;
            }


            for (int y = 0; y <= chkEngineList.Items.Count - 1; y++)
            {
                if (eng == null)
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        eng = eng + chkEngineList.Items[y].Value;
                    }
                }
                else
                {
                    if (chkEngineList.Items[y].Selected == true)
                    {
                        eng = eng + "," + chkEngineList.Items[y].Value;
                    }
                }
            }

            for (int z = 0; z <= chkProductLst.Items.Count - 1; z++)
            {
                if (prd == null)
                {
                    if (chkProductLst.Items[z].Selected == true)
                    {
                        prd = prd + chkProductLst.Items[z].Value;
                    }
                }
                else
                {
                    if (chkProductLst.Items[z].Selected == true)
                    {
                        prd = prd + "," + chkProductLst.Items[z].Value;
                    }
                }
            }

            string frmd = frmdate.Date.Value.ToString("yyyy-MM-dd");
            string tod  = todate.Date.Value.ToString("yyyy-MM-dd");

            objclsChartProperty.QueryParameter = "declare @Snm varchar(5000);declare @Eng varchar (5000);declare @Pid varchar (5000);declare @sdt datetime;declare @edt datetime;set @Snm='" + sit + "' set @Eng='" + eng + "' set @Pid='" + prd + "' set @sdt='" + frmd + "' set @edt='" + tod + "'   ";

            Dashboard1.BindChart(objclsChartProperty);
            Chart chart1 = new Chart();

            chart1 = (Chart)Dashboard1.FindControl("chart1");
            if (chart1.Series.Count == 0)
            {
                Dashboard1.Visible = false;
            }
        }