/// <summary> /// Bind list of managers for searching /// </summary> protected void fillsearchmanager() { dropassign.Items.Clear(); //This action selects the employee according to Roles id "7", if you chnage the roles please change in Stored Procedure too. if (ViewState["add"] != null && ViewState["add"].ToString() == "1" && ViewState["isadmin"] == null) { ListItem li2 = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); dropassign.Items.Insert(0, li2); dropassign.SelectedIndex = 0; return; } objuser.action = "selectassignmanagerself"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; objuser.managerid = Session["userid"].ToString(); objuser.activestatus = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropassign.DataSource = ds; //dropassign.DataTextField = "username"; //dropassign.DataValueField = "nid"; //dropassign.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropassign, "username", "nid"); } ListItem li = new ListItem("--All Manager--", ""); dropassign.Items.Insert(0, li); }
/// <summary> /// fiil List of Employee For Search /// </summary> private void fillemployee() { if (ViewState["add"] == null || ViewState["add"].ToString() == "") { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); drpemployee.Items.Insert(0, li); drpemployee.SelectedIndex = 0; } else { objuser.loginid = ""; objuser.name = ""; objuser.companyid = Session["companyid"].ToString(); objuser.action = "select"; objuser.activestatus = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { drpemployee.DataSource = ds; drpemployee.DataTextField = "username"; drpemployee.DataValueField = "nid"; drpemployee.DataBind(); ListItem li = new ListItem("--All Employees--", ""); drpemployee.Items.Insert(0, li); drpemployee.SelectedIndex = 0; } } }
/// <summary> /// Bind list of managers who assigned the tasks /// </summary> /// <summary> /// Fill tasks drop down for searching /// </summary> /// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveCheck(ds.Tables[0], dropemployee, "username", "nid"); } }
protected void fillemployee() { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); ListItem li = new ListItem("--Select Employee--", ""); dropemployee.Items.Insert(0, li); //dropemployee.Text = Session["userid"].ToString(); dropemployee.SelectedIndex = 0; }
protected void btnupload_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { string filename = ""; string path2 = ""; string datetime = DateTime.Now.ToFileTimeUtc().ToString(); try { objuser.id = Session["userid"].ToString(); String extension = Path.GetExtension(FileUpload1.PostedFile.FileName); if (extension.ToUpper() != ".JPG" && extension.ToUpper() != ".JPEG" && extension.ToUpper() != ".PNG" && extension.ToUpper() != ".GIF") { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('Selected file has invalid format');</script>", false); return; } filename = "Profile_" + datetime + extension; ViewState["filename"] = filename; //string path = Server.MapPath(FileUpload1.PostedFile.FileName); string path = AppDomain.CurrentDomain.BaseDirectory + "\\webfile\\profile\\" + filename; ViewState["path"] = @"webfile/profile/" + filename; FileUpload1.SaveAs(path); path = Server.MapPath("webfile/profile/" + filename); path2 = Server.MapPath("webfile/profile/thumb/" + filename); objimg.CreateThumbnail(100, 100, path, path2); //Find image control shown on top from Master page and change url // HtmlImage homethumbimage = (HtmlImage)this.Master.FindControl("imgphoto"); } catch (Exception ex) { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('" + ex.ToString() + "'Server error please try again later.');</script>", false); return; } objuser.imgurl = ViewState["filename"].ToString(); objuser.action = "changephoto"; ds = objuser.ManageEmployee(); Response.Cookies["user"]["profilephoto"] = filename; Session["profilephoto"] = filename; binddetail(); } else { ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('Please select a file');</script>", false); return; } }
protected void btnChangeEmail_OnClick(object sender, EventArgs e) { objuser.id = hidid.Value; objuser.action = "editemail"; objuser.usertype = Session["usertype"].ToString(); objuser.email = txtemail.Text; ds = objuser.ManageEmployee(); ScriptManager.RegisterStartupScript(this.Page, this.GetType(), "temp", "<script type='text/javascript'>alert('Your Email ID changed successfully!');hidediv();</script>", false); bindEmail(); }
public void GetAllEmployee(string EmpID, string AppLoginKey, string CompanyID) { ClsUser objuser = new ClsUser(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); if (checkAppKey(EmpID, AppLoginKey)) { objuser.loginid = ""; objuser.name = ""; objuser.companyid = CompanyID; objuser.action = "select"; objuser.activestatus = "active"; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { ResponseData(objGen.serilizeinJson(ds.Tables[0])); } else { ResponseData("[]"); } } else { ResponseError(); } }
/// <summary> /// Fill Employee to select for those logged in user is a Manager /// </summary> protected void fillemployee() { if (ViewState["add"] == null && ViewState["approvetimesheet"] == null) { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); dropemployee.Items.Insert(0, li); dropemployee.SelectedIndex = 0; } else { //objuser.action = "select"; //objuser.companyid = Session["companyid"].ToString(); //objuser.id = Session["userid"].ToString(); ; objuser.action = "selectbymanagerwith"; objuser.companyid = Session["companyid"].ToString(); objuser.managerid = Session["userid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropemployee.DataSource = ds; //dropemployee.DataTextField = "username"; //dropemployee.DataValueField = "nid"; //dropemployee.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); // ListItem li = new ListItem("--All Employees--", ""); // dropemployee.Items.Insert(0, li); } dropemployee.Text = Session["userid"].ToString(); } }
public static List <string> getName(string prefixText) { ClsUser objuser = new ClsUser(); DataSet ds1 = new DataSet(); objuser.id = ""; objuser.action = "SearchActiveUsersExceptMe"; objuser.deptid = ""; objuser.fname = ""; objuser.companyid = HttpContext.Current.Session["CompanyId"].ToString(); ds1 = objuser.ManageEmployee(); List <string> items = new List <string>(); if (ds1.Tables[0].Rows.Count > 0) { for (int i = 0; i < ds1.Tables[0].Rows.Count; i++) { items.Add(ds1.Tables[0].Rows[i]["username"].ToString().ToUpper()); } } var returnList = items.Where(item => item.Contains(prefixText.ToUpper())).ToList(); returnList.Sort(); return(returnList); }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request.QueryString["receiverid"] == null) { Response.Redirect("error.html"); } else { objda.id = Request.QueryString["receiverid"].ToString(); objda.action = "getempbyfileshare"; ds = objda.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { Session["email_empid"] = ds.Tables[0].Rows[0]["nid"].ToString(); Session["email_recemail"] = ds.Tables[0].Rows[0]["emailid"].ToString(); Session["email_empname"] = ds.Tables[0].Rows[0]["fname"].ToString() + " " + ds.Tables[0].Rows[0]["lname"].ToString(); Session["email_maxupload"] = ds.Tables[0].Rows[0]["filesize"].ToString(); recname.InnerHtml = "Send file to " + ds.Tables[0].Rows[0]["fname"].ToString() + " " + ds.Tables[0].Rows[0]["lname"].ToString(); } else { Response.Redirect("linkexpired.html"); } } } }
public static string saveempFileLink(string nid) { ClsUser objts = new ClsUser(); DataSet ds = new DataSet(); string msg = ""; msg = "failed"; objts.action = "setfilesharelink"; objts.id = nid; try { ds = objts.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { msg = ds.Tables[0].Rows[0]["filesharelink"].ToString(); } return(msg); } catch (Exception ex) { msg = ex.Message; return(msg); } }
/// <summary> /// fiil List of Employee For Search /// </summary> private void fillemployee() { if (ViewState["add"] == null || ViewState["add"].ToString() == "") { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); drpemployee.Items.Insert(0, li); drpemployee.SelectedIndex = 0; } else { objuser.loginid = ""; objuser.name = ""; objuser.companyid = Session["companyid"].ToString(); objuser.action = "select"; objuser.activestatus = "active"; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveDDL(ds.Tables[0], drpemployee, "username", "nid"); ListItem li = new ListItem("--All Employees--", ""); drpemployee.Items.Insert(0, li); drpemployee.SelectedIndex = 0; } } }
/// <summary> /// Bind list of managers who assigned the tasks /// </summary> /// <summary> /// Fill tasks drop down for searching /// </summary> /// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { if (ViewState["add"] == null || ViewState["add"].ToString() == "") { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); dropemployee.Items.Insert(0, li); dropemployee.SelectedIndex = 0; hidsemployeeid.Value = Session["userid"].ToString() + ","; } else { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveCheck(ds.Tables[0], dropemployee, "username", "nid"); } //ListItem li = new ListItem("--All Employees--", ""); //dropemployee.Items.Insert(0, li); //dropemployee.SelectedIndex = 0; } }
public void fillusers() { ClsUser objuser = new ClsUser(); objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropemployee.DataSource = ds; //dropemployee.DataTextField = "username"; //dropemployee.DataValueField = "nid"; //dropemployee.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], droppreperedby4, "username", "nid"); objgen.fillActiveInactiveDDL(ds.Tables[0], dropfinilizedby5, "username", "nid"); ListItem li = new ListItem("--Select--", ""); droppreperedby4.Items.Insert(0, li); dropfinilizedby5.Items.Insert(0, li); } droppreperedby4.SelectedIndex = 0; dropfinilizedby5.SelectedIndex = 0; }
/// <summary> /// Fill Employee to select for those logged in user is a Manager /// </summary> protected void fillemployee() { if (ViewState["add"] == null && ViewState["approvetimesheet"] == null) { ListItem li = new ListItem(Session["username"].ToString(), Session["userid"].ToString()); dropemployee.Items.Insert(0, li); dropemployee.SelectedIndex = 0; } else { objuser.action = "selectactive"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { dropemployee.DataSource = ds; dropemployee.DataTextField = "username"; dropemployee.DataValueField = "nid"; dropemployee.DataBind(); } dropemployee.Text = Session["userid"].ToString(); } }
protected void fillemployee() { objuser.action = "SelectactiveWithEnrollNo"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { //dropemployee.DataSource = ds; //dropemployee.DataTextField = "username"; //dropemployee.DataValueField = "nid"; //dropemployee.DataBind(); objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "enrollno"); ListItem li = new ListItem("--All Employees--", ""); dropemployee.Items.Insert(0, li); } objAtt.Enrollno = Session["userid"].ToString(); objAtt.Action = "getEnrollNo"; ds = objAtt.OpAttendance(); if (ds.Tables[0].Rows.Count > 0) { if (ds.Tables[0].Rows[0]["enrollno"] != null && ds.Tables[0].Rows[0]["enrollno"].ToString() != "") { Att_EnrollNo.Value = ds.Tables[0].Rows[0]["enrollno"].ToString(); } else { Att_EnrollNo.Value = "0"; } } }
/// <summary> /// Bind list of managers who assigned the tasks /// </summary> /// <summary> /// Fill tasks drop down for searching /// </summary> /// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { objuser.action = "selectbymanagerwith"; objuser.companyid = Session["companyid"].ToString(); objuser.managerid = Session["userid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveCheck(ds.Tables[0], dropemployee, "username", "nid"); } if (ds.Tables[0].Rows.Count == 1) { dropemployee.Items[0].Selected = true; divemp.Visible = false; } }
public void fillemployee() { objuser.fname = ""; objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); objuser.action = "selectactive"; objuser.id = ""; ds = objuser.ManageEmployee(); dropEmployee.DataSource = ds; dropEmployee.DataTextField = "username"; dropEmployee.DataValueField = "nid"; dropEmployee.DataBind(); }
public void sendreschedulemail(DataTable dt, string companyid) { ClsUser objuser = new ClsUser(); DataAccess objda = new DataAccess(); DataSet ds = new DataSet(); string bccemail = ""; string receiver = ""; string cc = ""; string bcc = bccemail; string filename = ""; string message = ""; if (dt != null) { if (dt.Rows.Count > 0) { //Get users who have Access to Add Schedule to Send Email CC cc = objda.GetCompanyProperty("ReceiverMail") + ","; objuser.action = "selectschedulemanager"; objuser.companyid = companyid; objuser.id = ""; ds = objuser.ManageEmployee(); if (ds != null) { if (ds.Tables[1].Rows.Count > 0) { //This will return all managers Email Id separated by comma if (ds.Tables[1].Rows[0]["EmailCC"] != null) { cc = ds.Tables[1].Rows[0]["EmailCC"].ToString(); } } } for (int i = 0; i < dt.Rows.Count; i++) { receiver = dt.Rows[i]["emailid"].ToString() + ","; message = dt.Rows[i]["mailmessage"].ToString(); string subject = dt.Rows[i]["mailsubject"].ToString(); try { objda.SendEmail(receiver, subject, message, cc, bcc, filename); } catch { } } } } }
/// <summary> /// Bind list of managers who assigned the tasks /// </summary> protected void fillmanager() { dropassign.Items.Clear(); //This action selects the employee according to Roles id "7", if you chnage the roles please change in Stored Procedure too. objuser.action = "selectassignmanager"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { dropassign.DataSource = ds; dropassign.DataTextField = "username"; dropassign.DataValueField = "nid"; dropassign.DataBind(); } ListItem li = new ListItem("--All Manager--", ""); dropassign.Items.Insert(0, li); }
public static string deletedata(string companyid, string nid) { ClsUser objda = new ClsUser(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); objda.action = "delete"; objda.id = nid; ds = objda.ManageEmployee(); string result = objgen.serilizeinJson(ds.Tables[0]); return(result); }
public static string getManager(string companyid) { ClsUser objuser = new ClsUser(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); objuser.action = "selectactive"; objuser.id = ""; objuser.companyid = companyid; ds = objuser.ManageEmployee(); string result = objgen.serilizeinJson(ds.Tables[0]); return(result); }
protected void employee_selecetdIndexChanged(object sender, EventArgs e) { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = drop_employeName.Text; ds = objuser.ManageEmployee(); drop_departmentName.Enabled = false; drop_departmentName.Text = ds.Tables[0].Rows[0]["deptid"].ToString(); updatePanelSearch.Update(); /* * Cls_Asset objts = new Cls_Asset(); * DataSet ds1 = new DataSet(); * GeneralMethod objgen = new GeneralMethod(); * objts.name = ""; * objts.action = "select"; * objts.companyId = Session["companyid"].ToString(); * objts.nid = drop_employeName.SelectedItem.Value; * ds1 = objts.ManageGetDepartByEmployee(); * drop_departmentName.SelectedItem.Value = drop_employeName.SelectedItem.Value; */ }
public void filleml() { objuser.action = "selectactive"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { dropemployee.DataSource = ds; dropemployee.DataValueField = "nid"; dropemployee.DataTextField = "username"; dropemployee.DataBind(); } dropemployee.Items.Insert(0, new ListItem("--Select--", "")); }
/// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { objuser.action = "select"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveDDL(ds.Tables[0], dropemployee, "username", "nid"); } ListItem li = new ListItem("--All Employees--", ""); dropemployee.Items.Insert(0, li); dropemployee.Text = Session["userid"].ToString(); }
protected void bindemployee() { listcode1.Items.Clear(); objuser.action = "selectactive"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { listcode1.DataSource = ds; listcode1.DataTextField = "username"; listcode1.DataValueField = "nid"; listcode1.DataBind(); } }
/// <summary> /// Fill Employee to select as a manager /// </summary> protected void fillmanager() { objuser.action = "selectactive"; objuser.companyid = Session["companyid"].ToString(); objuser.id = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { dropmanager.DataSource = ds; dropmanager.DataTextField = "username"; dropmanager.DataValueField = "nid"; dropmanager.DataBind(); ListItem li = new ListItem("--Select--", ""); dropmanager.Items.Insert(0, li); dropmanager.SelectedIndex = 0; } }
/// <summary> /// Bind list of managers who assigned the tasks /// </summary> /// <summary> /// Fill tasks drop down for searching /// </summary> /// <summary> /// Fill Employee to select for those who have admin Right /// </summary> protected void fillemployee() { objuser.loginid = ""; objuser.name = ""; objuser.companyid = Session["companyid"].ToString(); objuser.action = "select"; objuser.activestatus = ""; ds = objuser.ManageEmployee(); if (ds.Tables[0].Rows.Count > 0) { objgen.fillActiveInactiveCheck(ds.Tables[0], dropemployee, "username", "nid"); } //ListItem li = new ListItem("--All Employees--", ""); //dropemployee.Items.Insert(0, li); //dropemployee.SelectedIndex = 0; }
/// <summary> /// Fill TASKS List boxes /// </summary> protected void filladdemployees() { listavailcode2.Items.Clear(); listavailcode1.Items.Clear(); objuser.action = "selectactive"; objuser.name = ""; objuser.id = ""; objuser.companyid = Session["companyId"].ToString(); ds = objuser.ManageEmployee(); listavailcode1.DataSource = ds; listavailcode1.DataTextField = "username"; listavailcode1.DataValueField = "nid"; listavailcode1.DataBind(); int count = listavailcode1.Items.Count; string[] groupval = hidgroupid.Value.Split(','); string[] groupname = hidgroupname.Value.Split(','); for (int i = 0; i < groupval.Length - 1; i++) { ListItem li = new ListItem(groupname[i], groupval[i]); listavailcode2.Items.Add(li); } int count2 = listavailcode2.Items.Count; for (int i = 0; i < count; i++) { for (int j = 0; j < count2; j++) { //Remove the expenses from Listcode1 those are already exists in group if (listavailcode1.Items[i].Value == listavailcode2.Items[j].Value) { listavailcode1.Items.RemoveAt(i); count = listavailcode1.Items.Count; i = i - 1; break; } } } }
public static string getdata(string nid, string companyid) { ClsUser objuser = new ClsUser(); DataSet ds = new DataSet(); GeneralMethod objgen = new GeneralMethod(); objuser.fname = ""; objuser.action = "select"; objuser.companyid = companyid; objuser.id = nid; objuser.activestatus = ""; objuser.deptid = ""; ds = objuser.ManageEmployee(); string result = ""; if (nid == "") { result = objgen.serilizeinJson(ds.Tables[0]); } else { result = objgen.serilizeinJson(ds.Tables[0]); if (ds.Tables[1].Rows.Count > 0) { result = result + "##{}##" + objgen.serilizeinJson(ds.Tables[1]); } else { result = result + "##{}##" + ""; } if (ds.Tables[2].Rows.Count > 0) { result = result + "##{}##" + objgen.serilizeinJson(ds.Tables[2]); } else { result = result + "##{}##" + ""; } } return(result); }