protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { InventoryLogic iil = new InventoryLogic(); Inventory c1 = iil.SelectByID(Convert.ToInt32(Request.QueryString["id"])); RawMaterialLogic rrl = new RawMaterialLogic(); RawMaterial r1 = rrl.SelectByID(c1.RawMaterialID); if (c1 != null) { Label1.Text = r1.Name; Label2.Text = c1.Quantity.ToString(); Label3.Text = c1.TrDate.ToString(); Label4.Text = c1.Remarks; } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { if (!IsPostBack) { SupplierLogic SL = new SupplierLogic(); DataTable dt = SL.SelectHistory(Convert.ToInt32(Request.QueryString["ID"])); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label2.Visible = true; } else { Table1.Visible = true; Label2.Visible = false; Label1.Text = dt.Rows[0]["Name"].ToString(); } } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("MARKETING MANAGER") || e2.Designation.Equals("MARKETING EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("DESIGNER")) { if (!IsPostBack) { CustomerLogic CL = new CustomerLogic(); Customer c1 = CL.SelectByID(Convert.ToInt32(Request.QueryString["id"])); TextBox1.Text = c1.Name; TextBox2.Text = c1.Email; TextBox3.Text = c1.ContactPerson; TextBox8.Text = c1.Phone; TextArea1.Text = c1.OfficeAddress; TextBox5.Text = c1.DeliveryAddress; TextBox6.Text = c1.FactoryAddress; TextBox7.Text = c1.GodownAddress; TextBox9.Text = c1.OtherAddress; TextBox4.Text = c1.HeadOffice; } } else { Response.Redirect("Access.aspx"); } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { RawMaterialLogic rl = new RawMaterialLogic(); RawMaterial r1 = rl.SelectByID(Convert.ToInt32(e.CommandArgument)); if (r1 != null) { int i = rl.Delete(r1.RawMaterialID); if (i==1) { Response.Redirect("RawMatList.aspx"); } else { Response.Redirect("CustomerList.aspx"); } } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!(e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE"))) { OrderLogic ol = new OrderLogic(); Order o1=ol.SelectByID(Convert.ToInt32(Request.QueryString["id"]));; if (o1 != null) { ProductLogic pl = new ProductLogic(); Product p1 = pl.SelectByProductID(o1.ProductID); Label1.Text = p1.Name; Label2.Text = o1.QuotationID.ToString(); Label3.Text = o1.Quantity.ToString(); Label4.Text = o1.Rate.ToString(); Label5.Text = o1.PONumber.ToString(); Label6.Text = o1.PODate.ToString("dd/MM/yyyy"); Label7.Text = o1.CreateDate.ToString("dd/MM/yyyy"); Label8.Text = o1.Status; Label9.Text = o1.StatusRemarks; Label10.Text = o1.DeliveryAddress; Label11.Text = o1.DeliveryDate.ToString("dd/MM/yyyy"); String oo = o1.AttachPO; lnkImage1.Text = oo.Substring(25); lnkImage1.NavigateUrl = oo; } } else { Response.Redirect("Access.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { if (txtPassword.Text.Equals(TextBox3.Text)) { EmployeeLogic el = new EmployeeLogic(); if (Request.QueryString["uic"] != null) { Employee e1 = el.SelectByUIC((Request.QueryString["uic"])); e1.Password = TextBox3.Text; el.Update(e1); Response.Redirect("Login.aspx"); } else if (Request.QueryString["code"] != null) { Employee e1 = el.SelectByCode((Request.QueryString["code"])); e1.Password = TextBox3.Text; el.Update(e1); Response.Redirect("Login.aspx"); } } else { Label1.Visible = true; } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("ACCOUNTATANT")) { InvoiceLogic iv=new InvoiceLogic(); DataTable dt=iv.SelectForInvoice(Convert.ToInt32(Request.QueryString["ID"])); Label1.Text = dt.Rows[0]["CustomerName"].ToString(); TextArea1.InnerText = dt.Rows[0]["OfficeAddress"].ToString(); TextBox8.Text = "27460000277C"; TextBox9.Text = "400016/C/6, DTD.01.04.96"; Label2.Text = dt.Rows[0]["CustomerName"].ToString(); txt.InnerText = dt.Rows[0]["officeAddress"].ToString(); TextBox11.Text = "400016/C/6, DTD.01.04.96"; TextBox12.Text = "27460000277C"; TextBox16.Text = "27460000277C"; TextBox17.Text = "400016/C/6, DTD.01.04.96"; TextBox18.Text = dt.Rows[0]["ProductName"].ToString(); TextBox33.Text = dt.Rows[0]["Quantity"].ToString(); TextBox20.Text = dt.Rows[0]["Rate"].ToString(); txtAmount.Text = (Convert.ToSingle(TextBox33.Text) * Convert.ToSingle(TextBox20.Text)).ToString(); } else { Response.Redirect("Access.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { OrderLogic ol = new OrderLogic(); DataTable dt = ol.SelectJob(Convert.ToInt32(Request.QueryString["ID"])); Label12.Text = dt.Rows[0]["CustomerName"].ToString(); Label14.Text = dt.Rows[0]["JobName"].ToString(); Label13.Text = dt.Rows[0]["PONumber"].ToString(); Label15.Text = Convert.ToDateTime(dt.Rows[0]["PODate"]).ToString("dd/MM/yyyy"); Label11.Text = DateTime.Now.ToString("dd/MM/yyyy"); Label16.Text = Convert.ToDateTime(dt.Rows[0]["DeliveryDate"]).ToString("dd/MM/yyyy"); Label17.Text = dt.Rows[0]["Quantity"].ToString(); } else { Response.Redirect("Access.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { AttendanceLogic al = new AttendanceLogic(); DataTable dt = al.Select(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label3.Visible = true; } else { Table1.Visible = true; Label3.Visible = false; } } else { Response.Redirect("Access.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { if ((TextBox3.Text.Equals("")) && (TextBox2.Text.Equals(""))) { Label3.Visible = true; } else if (TextBox2.Text.Equals("")) { Label2.Visible = true; } else if (TextBox3.Text.Equals("")) { Label1.Visible = true; } else { EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.selectUP(TextBox3.Text, TextBox2.Text); if (e1.EmployeeID > 0) { Session["EmployeeID"] = e1.EmployeeID; Response.Redirect("home.aspx"); } else { //Response.Redirect("login.aspx"); Label3.Text = "Invalid Username or Password"; Label3.Visible = true; } } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("MARKETING MANAGER") || e2.Designation.Equals("MARKETING EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("DESIGNER") || e2.Designation.Equals("EMPLOYEE")) { if(!IsPostBack){ CustomerLogic CL = new CustomerLogic(); DataTable dt = CL.SelectAll(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } } } else { Response.Redirect("Access.aspx"); } }
protected void SendMsg(Int64 toNo) { String result = "SMS sent successfully!!"; EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectPhone(toNo); try { SMS.APIType = SMSGateway.Site2SMS; SMS.MashapeKey = "v4srqxZ6drmshFbuHpmBTRAEM12Yp1zHxB4jsnXVXxzm7DxXCJ"; SMS.Username = "******"; SMS.Password = "******"; Random r = new Random(); int randomNumber = r.Next(1001, 9999); e1.SMSCode = randomNumber.ToString(); el.Update(e1); SMS.SendSms(toNo.ToString(), "Dear Customer ! Please find your recovery code here : " + randomNumber.ToString()); Response.Redirect("SCode.aspx"); } catch (Exception ex) { result = "SMS sending failed!!"; } ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(" + result + ")", true); }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("MARKETING MANAGER") || e2.Designation.Equals("MARKETING EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("DESIGNER") || e2.Designation.Equals("EMPLOYEE")) { CustomerLogic cl = new CustomerLogic(); Customer c1 = cl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); if (c1 != null) { Label1.Text = c1.Name; Label2.Text = c1.Email; Label3.Text = c1.ContactPerson; Label4.Text = c1.Phone; Label5.Text = c1.OfficeAddress; Label6.Text = c1.DeliveryAddress; Label7.Text = c1.FactoryAddress; Label8.Text = c1.GodownAddress; Label9.Text = c1.OtherAddress; Label10.Text = c1.HeadOffice; } } else { Response.Redirect("Access.aspx"); } }
protected void Button2_Click(object sender, EventArgs e) { if (FileUpload1.HasFile) { Label1.Visible = false; DataSet ds = new DataSet(); String path = ""; string ticks = DateTime.Now.Ticks.ToString(); if (FileUpload1.HasFile) { FileUpload1.SaveAs(Server.MapPath("Images/" + ticks + FileUpload1.FileName)); path = Server.MapPath("Images/" + ticks + FileUpload1.FileName); OpenExcelFile(path, ref ds); } AttendanceLogic al = new AttendanceLogic(); Attendance a = new Attendance(); DateTime d1 = new DateTime(); for (int i = 0; i < ds.Tables[0].Rows.Count; i++) { a.EmployeeID = Convert.ToInt32(ds.Tables[0].Rows[i]["EmployeeID"]); if (!DateTime.TryParseExact(ds.Tables[0].Rows[i]["ADate"].ToString(), "dd/MM/yyyy", null, System.Globalization.DateTimeStyles.None, out d1)) { } a.Adate = d1; if (ds.Tables[0].Rows[i]["Mark"].ToString().Equals("P")) { a.Mark = true; } else if (ds.Tables[0].Rows[i]["Mark"].ToString().Equals("A")) { a.Mark = false; } al.Insert(a); } ds.Tables[0].Columns.Add(new DataColumn("EmployeeName")); EmployeeLogic el = new EmployeeLogic(); for (int i = 0; i <= ds.Tables[0].Rows.Count - 1; i++) { ds.Tables[0].Rows[i]["EmployeeName"] = (el.SelectByID(Convert.ToInt32(ds.Tables[0].Rows[i]["EmployeeID"]))).Name; } Repeater1.DataSource = ds; Repeater1.DataBind(); } else { Label1.Visible = true; } }
protected void Button1_Click(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectByCode(TextBox2.Text); if (e1!=null) { Response.Redirect("ResetPassword.aspx?code=" + e1.SMSCode); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("MARKETING MANAGER") || e2.Designation.Equals("MARKETING EMPLOYEE") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { QuotationLogic QL = new QuotationLogic(); DataTable dt = QL.SelectAllJoined(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } CustomerLogic cl = new CustomerLogic(); DataTable dt1 = cl.SelectAll(); dt1.Rows.Add(0, "All Customer", null, null, null, null, null, null, null, null, null); dt1.DefaultView.Sort = "CustomerID"; DropDownList1.DataSource = dt1; DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "CustomerID"; DropDownList1.DataBind(); DropDownList1.SelectedItem.Text = "All Customer"; ProductLogic pl = new ProductLogic(); DataTable dt2 = pl.SelectAll(); dt2.Rows.Add(0, "All Product", null, null, null, null, null, null, null, null); dt2.DefaultView.Sort = "ProductID"; DropDownList2.DataSource = dt2; DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "ProductID"; DropDownList2.DataBind(); DropDownList2.SelectedItem.Text = "All Product"; } else { Response.Redirect("Access.aspx"); } } }
protected void Button1_Click(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e1.EmployeeID > 0) { if (TextBox1.Text.Equals(e1.Password)) { Response.Redirect("Home.aspx"); } } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { repdiv.Visible = false; EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectByID(Convert.ToInt32(e.CommandArgument)); Label1.Text = "Attendance Report for "+e1.Name; empreport.Visible = true; AttendanceLogic al = new AttendanceLogic(); DataTable dt = al.SelectForEmp(Convert.ToInt32(e.CommandArgument)); Repeater2.DataSource = dt; Repeater2.DataBind(); }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE")) { } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { if (!IsPostBack) { if (Convert.ToInt32(Request.QueryString["id"]) > 0) { RawMaterialLogic rl = new RawMaterialLogic(); RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); TextBox2.Text = r1.Name; TextBox3.Text = r1.Code.ToString(); TextArea1.Text = r1.Descrition; TextBox4.Text = r1.Unit; TextBox5.Text = r1.MinQuantity.ToString(); SupplierLogic sl = new SupplierLogic(); DropDownList1.DataSource = sl.SelectAll(); DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "SupplierID"; DropDownList1.DataBind(); Supplier s = sl.SelectByID(r1.SupplierID); DropDownList1.SelectedItem.Text = s.Name; DropDownList2.SelectedItem.Text = r1.Category; DropDownList3.SelectedItem.Text = r1.Type; } else { SupplierLogic sl = new SupplierLogic(); DropDownList1.DataSource = sl.SelectAll(); DropDownList1.DataTextField = "Name"; DropDownList1.DataValueField = "SupplierID"; DropDownList1.DataBind(); } } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { if (!IsPostBack) { RawMaterialLogic RL = new RawMaterialLogic(); DataTable dt = RL.SelectAllJoined(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } RawMaterialLogic rl = new RawMaterialLogic(); DataTable dt1 = rl.SelectAll(); dt1.Rows.Add(0, null, null, null, null, null, null, "All Category", null); dt1.DefaultView.Sort = "SupplierID"; DropDownList1.DataSource = dt1; DropDownList1.DataTextField = "Category"; DropDownList1.DataValueField = "SupplierID"; //DropDownList1.DataBind(); DropDownList1.SelectedItem.Text = "All Category"; SupplierLogic sl = new SupplierLogic(); DataTable dt2 = sl.SelectAll(); dt2.Rows.Add(0, "All Supplier", null, null, null); dt2.DefaultView.Sort = "SupplierID"; DropDownList2.DataSource = dt2; DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "SupplierID"; DropDownList2.DataBind(); DropDownList2.SelectedItem.Text = "All Supplier"; } } else { Response.Redirect("Access.aspx"); } }
protected void Button1_Click(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e1=el.SelectByID(Convert.ToInt32(Session["LockID"])); Employee e2=el.selectUP(e1.Username, TextBox1.Text); if (e2.EmployeeID > 0) { Session["EmployeeID"] = e2.EmployeeID; Response.Redirect(Session["LastLink"].ToString()); } else { ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "alertMessage", "alert(Invalid Password!)", true); } }
protected void Page_Load(object sender, EventArgs e) { Session["EmployeeID"] = null; Label3.Visible = false; if (!(Request.QueryString["UN"] == null && Request.QueryString["PW"] == null)) { EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.selectUP(Request.QueryString["UN"], Request.QueryString["PW"]); if (e1.EmployeeID > 0) { Session["EmployeeID"] = e1.EmployeeID; Response.Redirect("AllReports.aspx"); } } }
protected void Button1_Click(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); DataTable dt = el.Search(TextBox2.Text,DropDownList1.Text); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN")) { Label1.Text="Employee's Attendance Analysis"; empreport.Visible = false; EmployeeLogic OL = new EmployeeLogic(); DataTable dt = OL.SelectAll(); Repeater1.DataSource = dt; Repeater1.DataBind(); } else { Response.Redirect("Access.aspx"); } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("MARKETING MANAGER") || e2.Designation.Equals("MARKETING EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("COMERCIAL MANAGER") || e2.Designation.Equals("COMERCIAL EMPLOYEE") || e2.Designation.Equals("DESIGNER")) { CustomerLogic cl = new CustomerLogic(); Customer c1 = cl.SelectByID(Convert.ToInt32(e.CommandArgument)); if (c1 != null) { int i = cl.Delete(c1.CustomerID); Response.Redirect("CustomerList.aspx"); } } else { Response.Redirect("Access.aspx"); } }
protected void LinkButton1_Command(object sender, CommandEventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE")) { SupplierLogic sl = new SupplierLogic(); Supplier e1 = sl.SelectByID(Convert.ToInt32(e.CommandArgument)); if (e1 != null) { int i = sl.Delete(e1.SupplierID); Response.Redirect("SupplierList.aspx"); } } else { Response.Redirect("Access.aspx"); } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (!(e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("ACCOUNTATANT") || e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE"))) { ProductLogic PL = new ProductLogic(); DataTable dt = PL.SelectAllJoined(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } CustomerLogic cl = new CustomerLogic(); DataTable dt1 = cl.SelectAll(); dt1.Rows.Add(0, "All Customers", null, null, null, null, null, null, null, null, null); dt1.DefaultView.Sort = "CustomerID"; DropDownList2.DataSource = dt1; DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "CustomerID"; DropDownList2.DataBind(); //DropDownList2.SelectedValue = "All Customers"; } else { Response.Redirect("Access.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("MANAGING DIRECTOR") || e2.Designation.Equals("CHAIRMAN") || e2.Designation.Equals("PRODUCTION MANAGER") || e2.Designation.Equals("PRODUCTION EMPLOYEE")) { RawMaterialLogic rl = new RawMaterialLogic(); RawMaterial r1 = rl.SelectByID(Convert.ToInt32(Request.QueryString["id"])); SupplierLogic sl = new SupplierLogic(); if (r1 != null) { Label1.Text = r1.Name; Label2.Text = r1.Code.ToString(); Label3.Text = r1.Descrition; Label4.Text = r1.Unit; Label5.Text = r1.MinQuantity.ToString(); Supplier s1 = sl.SelectByID(r1.SupplierID); if (s1 != null) { Label6.Text = s1.Name; } else { Label6.Text = "-----"; } Label7.Text = r1.Category; Label8.Text = r1.Type; } } else { Response.Redirect("Access.aspx"); } } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (!e2.Designation.Equals("DESIGNER")) { EmployeeLogic EL = new EmployeeLogic(); DataTable dt1 = EL.SelectDes(); dt1.Rows.Add("All Designation"); DropDownList1.DataSource = dt1; DropDownList1.DataTextField = "Designation"; DropDownList1.DataValueField = "Designation"; DropDownList1.DataBind(); DropDownList1.SelectedValue = "All Designation"; DataTable dt = EL.SelectAll(); Repeater1.DataSource = dt; Repeater1.DataBind(); if (dt.Rows.Count == 0) { Table1.Visible = false; Label1.Visible = true; } else { Table1.Visible = true; Label1.Visible = false; } } else { Response.Redirect("Access.aspx"); } } }
public WindowAuthorization(EmployeeLogic logic) { InitializeComponent(); this.logic = logic; }
public WindowStatistic(StatisticLogicEmployee logic, EmployeeLogic logicE) { InitializeComponent(); this.logic = logic; employeeLogic = logicE; }
public void Init() { _employeeRepository = new Mock <IEmployeeRepository>(); _employeeLogic = new EmployeeLogic(_employeeRepository.Object); }
public EmployeesService() { _logic = new EmployeeLogic(); }
static void Main(string[] args) { IAwardLogic awardLogic = new AwardLogic(); IEmployeeLogic employeeLogic = new EmployeeLogic(); bool isRunning = true; while (isRunning) { Console.WriteLine("1. Employee"); Console.WriteLine("2. Award"); Console.WriteLine("3. Exit"); Console.WriteLine(); int decision; int second_decision; if (int.TryParse(Console.ReadLine(), out decision)) { switch (decision) { case 1: Console.WriteLine("1. Show all"); Console.WriteLine("2. Add new employee"); Console.WriteLine("3. Delete employee by id"); Console.WriteLine("4. Add new award for employee"); Console.WriteLine("5. Exit"); if (int.TryParse(Console.ReadLine(), out second_decision)) { switch (second_decision) { case 1: List <Employee> employees = employeeLogic.SelectEmployee(); foreach (var item in employees) { Console.Write($"ID employee: {item.Id}, "); Console.Write($"name: {item.Name}, "); Console.Write($"date of birth: {item.DateOfBirth}, "); Console.Write($"age: {item.Age}, "); if (item.Awards.Count > 0) { Console.WriteLine("awards:"); foreach (var award in item.Awards) { Console.Write($"ID award: {award.Id}, "); Console.WriteLine($"award title: {award.Title}"); } Console.WriteLine(); } else { Console.WriteLine(); } } break; case 2: string name; DateTime dateOfBirth; int age; Console.Write("Press name: "); name = Console.ReadLine(); Console.Write("Press date of birth (DD.MM.YYYY): "); List <int> date = Console.ReadLine().Split('.'). Select(x => int.Parse(x)).ToList(); dateOfBirth = new DateTime(date[2], date[1], date[0]); Console.Write("Press age: "); age = int.Parse(Console.ReadLine()); Console.WriteLine(employeeLogic.InsertIntoEmployee(name, dateOfBirth, age)); Console.WriteLine(); break; case 3: int id; Console.Write("Press id: "); id = int.Parse(Console.ReadLine()); Console.WriteLine(employeeLogic.DeleteEmployee(id)); Console.WriteLine(); break; case 4: int idAward; int idEmployee; Console.Write("Press award id: "); idAward = int.Parse(Console.ReadLine()); Console.Write("Press employee id: "); idEmployee = int.Parse(Console.ReadLine()); Console.WriteLine(employeeLogic.AddAwardForEmployee(idEmployee, idAward)); Console.WriteLine(); break; case 5: break; default: Console.WriteLine("Wrong number!"); break; } } else { Console.WriteLine("It is not a number!"); } break; case 2: Console.WriteLine("1. Show all"); Console.WriteLine("2. Add new award"); Console.WriteLine("3. Delete award by id"); Console.WriteLine("4. Exit"); if (int.TryParse(Console.ReadLine(), out second_decision)) { switch (second_decision) { case 1: List <Award> awards = awardLogic.SelectAward(); foreach (var item in awards) { Console.Write($"ID: {item.Id}, "); Console.WriteLine($"Title: {item.Title}"); } Console.WriteLine(); break; case 2: string title; Console.Write("Press title: "); title = Console.ReadLine(); Console.WriteLine(awardLogic.InsertIntoAward(title)); Console.WriteLine(); break; case 3: int id; Console.Write("Press id: "); id = int.Parse(Console.ReadLine()); Console.WriteLine(awardLogic.DeleteAward(id)); Console.WriteLine(); break; case 4: break; default: Console.WriteLine("Wrong number!"); break; } } else { Console.WriteLine("It is not a number!"); } break; case 3: isRunning = false; break; default: Console.WriteLine("Wrong number!"); break; } } else { Console.WriteLine("It is not a number!"); } } }
public ActionResult SaveUser(Guid?userId, string userName, bool enabled, string userCode, string realName, string organization, string organizationName, string department, string departmentName, string position, string positionName, string status, Employee employeeInfo, Guid[] roleIds) { bool result = false; EmployeeLogic empLogic = new EmployeeLogic(); EmployeeModel user = null; bool isCreate = userId == null; if (isCreate) { if (WebSecurity.UserNameExists(userName)) { return(Json(new { Result = false, ErrorMessage = String.Format("用户名[{0}]已存在", userName) })); } else { user = empLogic.CreateEmployeeModel(Guid.NewGuid(), userName); } } else { user = empLogic.GetEmployeeInfoById(userId.Value); if (user == null) { return(Json(new { Result = false, ErrorMessage = "用户不存在" })); } } user.UserCode = userCode; user.RealName = realName; user.Organization = organization; user.OrganizationName = organizationName; user.Department = department; user.DepartmentName = departmentName; user.Position = position; user.PositionName = positionName; user.Status = status; user.Gender = employeeInfo.Gender; user.Birthday = employeeInfo.Birthday; user.CellPhoneNumber = employeeInfo.CellPhoneNumber; user.LinePhoneNumber = employeeInfo.LinePhoneNumber; user.Email = employeeInfo.Email; user.Email2 = employeeInfo.Email2; user.QQ = employeeInfo.QQ; user.ID = employeeInfo.ID; user.Address = employeeInfo.Address; if (isCreate) { user.Enabled = enabled; WebSecurity.CreateUser(user, DefaultPassword, null, empLogic.InsertEmployeeHandler); result = true; } else { if (user.Enabled != enabled) { WebSecurity.EnabledUser(user.UserName, enabled); user.Enabled = enabled; } result = WebSecurity.UpdateUser(user, empLogic.UpdateEmployeeHandler); } if (roleIds != null) { result = WebSecurity.UpdateRolesForUser(user.UserId, roleIds); Functions.RemoveFunctionCache(new Guid[] { user.UserId }); } //加载该员工的成本信息 empLogic.LoadEmployeeCost(user); string jsonData = Newtonsoft.Json.JsonConvert.SerializeObject( new { Result = result, Data = user }); return(Content(jsonData)); }
public static void Start(string connectionString, bool isPostgres, string?azureStorageConnectionString, string?broadcastSecret, string?broadcastUrls, bool includeDynamic = true, bool detectSqlVersion = true) { AzureStorageConnectionString = azureStorageConnectionString; using (HeavyProfiler.Log("Start")) using (var initial = HeavyProfiler.Log("Initial")) { StartParameters.IgnoredDatabaseMismatches = new List <Exception>(); StartParameters.IgnoredCodeErrors = new List <Exception>(); string?logDatabase = Connector.TryExtractDatabaseNameWithPostfix(ref connectionString, "_Log"); SchemaBuilder sb = new CustomSchemaBuilder { LogDatabaseName = logDatabase, Tracer = initial }; sb.Schema.Version = typeof(Starter).Assembly.GetName().Version !; sb.Schema.ForceCultureInfo = CultureInfo.GetCultureInfo("en-US"); MixinDeclarations.Register <OperationLogEntity, DiffLogMixin>(); MixinDeclarations.Register <UserEntity, UserEmployeeMixin>(); MixinDeclarations.Register <OrderDetailEmbedded, OrderDetailMixin>(); MixinDeclarations.Register <BigStringEmbedded, BigStringMixin>(); ConfigureBigString(sb); OverrideAttributes(sb); if (!isPostgres) { var sqlVersion = detectSqlVersion ? SqlServerVersionDetector.Detect(connectionString) : SqlServerVersion.AzureSQL; Connector.Default = new SqlServerConnector(connectionString, sb.Schema, sqlVersion !.Value); } else { var postgreeVersion = detectSqlVersion ? PostgresVersionDetector.Detect(connectionString) : null; Connector.Default = new PostgreSqlConnector(connectionString, sb.Schema, postgreeVersion); } CacheLogic.Start(sb, serverBroadcast: sb.Settings.IsPostgres ? new PostgresBroadcast() : broadcastSecret != null && broadcastUrls != null ? new SimpleHttpBroadcast(broadcastSecret, broadcastUrls) : null);/*Cache*/ /* LightDynamic * DynamicLogic.Start(sb, withCodeGen: false); * LightDynamic */ DynamicLogicStarter.Start(sb); if (includeDynamic)//Dynamic { DynamicLogic.CompileDynamicCode(); DynamicLogic.RegisterMixins(); DynamicLogic.BeforeSchema(sb); }//Dynamic // Framework modules TypeLogic.Start(sb); OperationLogic.Start(sb); ExceptionLogic.Start(sb); QueryLogic.Start(sb); // Extensions modules MigrationLogic.Start(sb); CultureInfoLogic.Start(sb); FilePathEmbeddedLogic.Start(sb); BigStringLogic.Start(sb); EmailLogic.Start(sb, () => Configuration.Value.Email, (template, target, message) => Configuration.Value.EmailSender); AuthLogic.Start(sb, "System", "Anonymous"); /* null); anonymous*/ AuthLogic.Authorizer = new SouthwindAuthorizer(() => Configuration.Value.ActiveDirectory); AuthLogic.StartAllModules(sb, activeDirectoryIntegration: true); AzureADLogic.Start(sb, adGroups: true, deactivateUsersTask: true); ResetPasswordRequestLogic.Start(sb); UserTicketLogic.Start(sb); SessionLogLogic.Start(sb); TypeConditionLogic.RegisterCompile <UserEntity>(SouthwindTypeCondition.UserEntities, u => u.Is(UserEntity.Current)); ProcessLogic.Start(sb); PackageLogic.Start(sb, packages: true, packageOperations: true); SchedulerLogic.Start(sb); OmniboxLogic.Start(sb); UserQueryLogic.Start(sb); UserQueryLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); UserQueryLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); UserQueryLogic.RegisterTranslatableRoutes(); ChartLogic.Start(sb, googleMapsChartScripts: false /*requires Google Maps API key in ChartClient */); UserChartLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); UserChartLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); UserChartLogic.RegisterTranslatableRoutes(); DashboardLogic.Start(sb, GetFileTypeAlgorithm(p => p.CachedQueryFolder)); DashboardLogic.RegisterUserTypeCondition(sb, SouthwindTypeCondition.UserEntities); DashboardLogic.RegisterRoleTypeCondition(sb, SouthwindTypeCondition.RoleEntities); DashboardLogic.RegisterTranslatableRoutes(); ViewLogLogic.Start(sb, new HashSet <Type> { typeof(UserQueryEntity), typeof(UserChartEntity), typeof(DashboardEntity) }); SystemEventLogLogic.Start(sb); DiffLogLogic.Start(sb, registerAll: true); ExcelLogic.Start(sb, excelReport: true); ToolbarLogic.Start(sb); ToolbarLogic.RegisterTranslatableRoutes(); SMSLogic.Start(sb, null, () => Configuration.Value.Sms); NoteLogic.Start(sb, typeof(UserEntity), /*Note*/ typeof(OrderEntity)); AlertLogic.Start(sb, typeof(UserEntity), /*Alert*/ typeof(OrderEntity)); FileLogic.Start(sb); TranslationLogic.Start(sb, countLocalizationHits: false); TranslatedInstanceLogic.Start(sb, () => CultureInfo.GetCultureInfo("en")); HelpLogic.Start(sb); WordTemplateLogic.Start(sb); MapLogic.Start(sb); PredictorLogic.Start(sb, GetFileTypeAlgorithm(p => p.PredictorModelFolder)); PredictorLogic.RegisterAlgorithm(TensorFlowPredictorAlgorithm.NeuralNetworkGraph, new TensorFlowNeuralNetworkPredictor()); PredictorLogic.RegisterPublication(ProductPredictorPublication.MonthlySales, new PublicationSettings(typeof(OrderEntity))); RestLogLogic.Start(sb); RestApiKeyLogic.Start(sb); WorkflowLogicStarter.Start(sb, () => Starter.Configuration.Value.Workflow); ProfilerLogic.Start(sb, timeTracker: true, heavyProfiler: true, overrideSessionTimeout: true); // Southwind modules EmployeeLogic.Start(sb); ProductLogic.Start(sb); CustomerLogic.Start(sb); OrderLogic.Start(sb); ShipperLogic.Start(sb); StartSouthwindConfiguration(sb); TypeConditionLogic.Register <OrderEntity>(SouthwindTypeCondition.CurrentEmployee, o => o.Employee.Is(EmployeeEntity.Current)); if (includeDynamic)//2 { DynamicLogic.StartDynamicModules(sb); }//2 SetupCache(sb); Schema.Current.OnSchemaCompleted(); if (includeDynamic)//3 { DynamicLogic.RegisterExceptionIfAny(); }//3 } }
public void Update(Employee employee, EmployeeLogic employeeLogic, Action a) { var form = new FormChangeSkill(employee, employeeLogic, a); form.Show(); }
public ActionResult Grinding() { ViewBag.Employees = EmployeeLogic.GetEmployeeByID(0).Where(x => x.ID != currUser.ID); return(View(GrindingLogic.GetGrindingBatches(0))); }
public EmployeesController(EmployeeLogic employeeLogic, PaySummaryLogic paySummaryLogic) { _employeeLogic = employeeLogic; _paySummaryLogic = paySummaryLogic; }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (!(e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("ACCOUNTATANT") || e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE"))) { ProductLogic pl = new ProductLogic(); Product p1 = pl.SelectByProductID(Convert.ToInt32(Request.QueryString["id"]));; if (p1 != null) { Label1.Text = p1.Name; Label2.Text = p1.CreateDate.ToString("dd/MM/yyyy"); String st = p1.DesignFiles; String[] arr = st.Split(new String[] { "#,#" }, StringSplitOptions.RemoveEmptyEntries); if (arr.Length > 0) { lnkImage1.Text = arr[0].Substring(25); lnkImage1.NavigateUrl = arr[0]; } else { lnkImage1.Visible = false; } if (arr.Length > 1) { lnkImage2.Text = arr[1].Substring(25); lnkImage2.NavigateUrl = arr[1]; } else { lnkImage2.Visible = false; } if (arr.Length > 2) { lnkImage3.Text = arr[2].Substring(25); lnkImage3.NavigateUrl = arr[2]; } else { lnkImage3.Visible = false; } if (arr.Length > 3) { lnkImage4.Text = arr[3].Substring(25); lnkImage4.NavigateUrl = arr[3]; } else { lnkImage4.Visible = false; } if (arr.Length > 4) { lnkImage5.Text = arr[4].Substring(25); lnkImage5.NavigateUrl = arr[4]; } else { lnkImage5.Visible = false; } Label4.Text = p1.Status; Label5.Text = p1.Description; Label6.Text = p1.Size; Label7.Text = p1.Colors; Label8.Text = p1.Type; CustomerLogic cl = new CustomerLogic(); Customer c1 = cl.SelectByID(p1.CustomerID); Label9.Text = c1.Name; } } else { Response.Redirect("Access.aspx"); } } }
public FormThirdReq(EmployeeLogic employeeLogic, PaymentLogic paymentLogic) { InitializeComponent(); this.employeeLogic = employeeLogic; this.paymentLogic = paymentLogic; }
public EmployeeController() { _employeeLogic = new EmployeeLogic(); }
public FormEmployees(EmployeeLogic logic) { InitializeComponent(); this.logic = logic; }
public void Setup() { var employeeLogic = new EmployeeLogic(); Assert.IsNotNull(employeeLogic); }
protected void Page_Load(object sender, EventArgs e) { if (Request.QueryString["type"] == "login") { // login request string un = Request.QueryString["un"].ToString(); string pw = Request.QueryString["pw"].ToString(); Employee e1 = new EmployeeLogic().selectUP(un, pw); Response.Write(e1.EmployeeID + ";" + e1.Username + ";" + e1.Password + "---"); return; } else if (Request.QueryString["type"] == "notification") { // no other data is needed QuotationLogic ql = new QuotationLogic(); DataTable dt = ql.SelectNotification(); String resp = ""; foreach (DataRow dr in dt.Rows) { resp = resp + dr["ID"].ToString() + ";"; resp = resp + dr["Data"].ToString() + ";"; resp = resp + dr["Type"].ToString() + ";"; resp = resp + Convert.ToDateTime(dr["Date"]).ToString("dd-MM-yyyy HH:mm:ss") + "---"; } Response.Write(resp); } else if (Request.QueryString["type"] == "employee") { // no other data is needed EmployeeLogic el = new EmployeeLogic(); DataTable dt = el.SelectForAndroid(); String resp = ""; foreach (DataRow dr in dt.Rows) { resp = resp + dr["EmployeeID"].ToString() + ";"; resp = resp + dr["Name"].ToString() + ";"; resp = resp + dr["Phone"].ToString() + "---"; } Response.Write(resp); } else if (Request.QueryString["type"] == "employeeInfo") { // no other data is needed EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectByID(Convert.ToInt32(Request.QueryString["ID"])); String resp = ""; resp = resp + e1.EmployeeID + ";"; resp = resp + e1.Name + ";"; resp = resp + e1.Designation + ";"; resp = resp + e1.Address + ";"; resp = resp + e1.Email + ";"; resp = resp + e1.Phone + ";"; resp = resp + Convert.ToDateTime(e1.DOB.ToString("dd-MM-yyyy")) + ";"; resp = resp + Convert.ToDateTime(e1.DOJ.ToString("dd-MM-yyyy")) + ";"; resp = resp + e1.Photo + "---"; Response.Write(resp); } //else if (Request.QueryString["type"] == "Teamlist") //{ // // no other data is needed // TeamLogic tl = new TeamLogic(); // DataTable dt = tl.SelectAll(); // String resp = ""; // foreach (DataRow dr in dt.Rows) // { // resp = resp + dr["TeamID"].ToString() + "-"; // resp = resp + dr["Name"].ToString() + "-"; // resp = resp + dr["CreateDate"].ToString() + "-"; // resp = resp + dr["TeamLeadID"].ToString() + "-"; // resp = resp + dr["ProjectID"].ToString() + "#"; // } // Response.Write(resp); //} //else if (Request.QueryString["type"] == "Versionlist") //{ // // no other data is needed // ProjectVersionLogic PVL = new ProjectVersionLogic(); // DataTable dt = PVL.SelectAll(); // String resp = ""; // foreach (DataRow dr in dt.Rows) // { // resp = resp + dr["ProjectVersionID"].ToString() + "-"; // resp = resp + dr["Name"].ToString() + "-"; // // resp = resp + dr["ProjectID"].ToString() + "-"; // resp = resp + dr["ScheduledStartDate"].ToString() + "-"; // // resp = resp + dr["ActualStartDate"].ToString() + "-"; // resp = resp + dr["ScheduledEndDate"].ToString() + "#"; // } // Response.Write(resp); //} ////public string MD5Hash(string Password) //{ // MD5 md5 = new MD5CryptoServiceProvider(); // //compute hash from the bytes of text // md5.ComputeHash(ASCIIEncoding.ASCII.GetBytes(Password)); // //get hash result after compute it // byte[] result = md5.Hash; // StringBuilder strBuilder = new StringBuilder(); // for (int i = 0; i < result.Length; i++) // { // //change it into 2 hexadecimal digits // //for each byte // strBuilder.Append(result[i].ToString("x2")); // } // return strBuilder.ToString(); //} }
public async Task SaveEmployee_UpdatingValidEmployee_EmployeeUpdated() { var employeeData = new List <Employee> { new Employee { id = 999, name = "q", SportType = new List <SportType> { new SportType { id = 1, name = "aaa" } }, Position = new Position { id = 1, name = "123123" } } }.AsQueryable(); var sportTypeData = new List <SportType> { new SportType { id = 1, name = "aa" } }.AsQueryable(); var positionData = new List <Position> { new Position { id = 999, name = "q" } }.AsQueryable(); var employeeMockSet = new Mock <DbSet <Employee> >(); employeeMockSet.As <IDbAsyncEnumerable <Employee> >() .Setup(m => m.GetAsyncEnumerator()) .Returns(new TestDbAsyncEnumerator <Employee>(employeeData.GetEnumerator())); employeeMockSet.As <IQueryable <Employee> >() .Setup(m => m.Provider) .Returns(new TestDbAsyncQueryProvider <Employee>(employeeData.Provider)); employeeMockSet.As <IQueryable <Employee> >().Setup(m => m.Expression).Returns(employeeData.Expression); var sportTypeMockSet = new Mock <DbSet <SportType> >(); sportTypeMockSet.As <IDbAsyncEnumerable <SportType> >() .Setup(m => m.GetAsyncEnumerator()) .Returns(new TestDbAsyncEnumerator <SportType>(sportTypeData.GetEnumerator())); sportTypeMockSet.As <IQueryable <SportType> >() .Setup(m => m.Provider) .Returns(new TestDbAsyncQueryProvider <SportType>(sportTypeData.Provider)); sportTypeMockSet.As <IQueryable <SportType> >().Setup(m => m.Expression).Returns(sportTypeData.Expression); var positionMockSet = new Mock <DbSet <Position> >(); positionMockSet.As <IDbAsyncEnumerable <Position> >() .Setup(m => m.GetAsyncEnumerator()) .Returns(new TestDbAsyncEnumerator <Position>(positionData.GetEnumerator())); positionMockSet.As <IQueryable <Position> >() .Setup(m => m.Provider) .Returns(new TestDbAsyncQueryProvider <Position>(positionData.Provider)); positionMockSet.As <IQueryable <Position> >().Setup(m => m.Expression).Returns(positionData.Expression); var mockContext = new Mock <ExtremeSportDBEntities>(); mockContext.Setup(m => m.Employee).Returns(employeeMockSet.Object); mockContext.Setup(m => m.SportType).Returns(sportTypeMockSet.Object); mockContext.Setup(m => m.Position).Returns(positionMockSet.Object); var sportTypeLogic = new EmployeeLogic { Context = mockContext.Object }; var b = await sportTypeLogic.SaveEmployee(new DtoEmployee { Password = "******", Id = 999, Name = "qqqqqqqqqqq", Position = new DtoPosition { Id = 999 }, SportTypes = new List <DtoSportType> { new DtoSportType { Id = 1 } } }); Assert.AreEqual(b, true); employeeMockSet.Verify(m => m.Add(It.IsAny <Employee>()), Times.Never); mockContext.Verify(m => m.SaveChangesAsync(), Times.Once()); }
private void SearchEmployeeWelfare() { try { List <EmployeeWelfare> employeeWelfarelist = new List <EmployeeWelfare>(); //List<Employee> employeeList = // _IEmployeeFacade.GetEmployeeBasicInfoByBasicCondition(_View.EmployeeName, _View.EmployeeType, // _View.PositionId, _View.DepartmentId, // _View.RecursionDepartment, // Convert.ToInt32(_View.EmployeeStatusId), // _View.CompanyId); //employeeList = // HrmisUtility.RemoteUnAuthEmployee(employeeList, AuthType.HRMIS, _Operator, HrmisPowers.A605); List <Employee> employeeList = EmployeeLogic.GetEmployeeBasicInfoByBasicConditionRetModel(_View.EmployeeName, _View.EmployeeType, _View.PositionId, null, _View.DepartmentId, _View.CompanyId, _View.RecursionDepartment, HrmisPowers.A605, _Operator.Id, Convert.ToInt32(_View.EmployeeStatusId), null); if (employeeList != null) { foreach (Employee employee in employeeList) { EmployeeWelfare welfare = _IEmployeeWelfareFacade.GetEmployeeWelfareByAccountID(employee.Account.Id); if (welfare == null) { welfare = EmployeeWelfare.EmptyWelfare(); } welfare.AccumulationFund.BaseTemp = welfare.AccumulationFund.Base == null ? "" : welfare.AccumulationFund.Base.ToString(); welfare.AccumulationFund.SupplyBaseTemp = welfare.AccumulationFund.SupplyBase == null ? "" : welfare.AccumulationFund.SupplyBase.ToString(); welfare.SocialSecurity.BaseTemp = welfare.SocialSecurity.Base == null ? "" : welfare.SocialSecurity.Base.ToString(); welfare.SocialSecurity.YangLaoBaseTemp = welfare.SocialSecurity.YangLaoBase == null ? "" : welfare.SocialSecurity.YangLaoBase.ToString(); welfare.SocialSecurity.ShiYeBaseTemp = welfare.SocialSecurity.ShiYeBase == null ? "" : welfare.SocialSecurity.ShiYeBase.ToString(); welfare.SocialSecurity.YiLiaoBaseTemp = welfare.SocialSecurity.YiLiaoBase == null ? "" : welfare.SocialSecurity.YiLiaoBase.ToString(); welfare.AccumulationFund.EffectiveYearMonthTemp = EmployeeWelfare.YearAndMonth(welfare.AccumulationFund.EffectiveYearMonth); welfare.SocialSecurity.EffectiveYearMonthTemp = EmployeeWelfare.YearAndMonth(welfare.SocialSecurity.EffectiveYearMonth); welfare.Owner = employee.Account; employeeWelfarelist.Add(welfare); } } _View.EmployeeWelfareList = employeeWelfarelist; _View.Message = string.Format( "<span class='font14b'>共查到 </span><span class='fontred'>{0}</span><span class='font14b'> 条信息</span>", employeeList == null ? 0 : employeeList.Count); } catch (Exception ex) { _View.Message = string.Format("<span class='fontred'>{0}</span>", ex.Message); } }
private async void OnSave(object obj) { if (string.IsNullOrWhiteSpace(PasswordBindProp) && IsChangingPassword) { await PageDialogService.DisplayAlertAsync("", "Chưa nhập mật khẩu!", "OK"); return; } if (string.IsNullOrWhiteSpace(EmployeeBindProp.EmployeeName)) { await PageDialogService.DisplayAlertAsync("", "Chưa nhập tên tài khoản!", "OK"); return; } if (string.IsNullOrWhiteSpace(EmployeeBindProp.FullName)) { await PageDialogService.DisplayAlertAsync("", "Chưa nhập tên nhân viên!", "OK"); return; } if (PasswordBindProp != ConfirmedPasswordBindProp) { await PageDialogService.DisplayAlertAsync("", "Mật khẩu không trùng khớp!", "OK"); return; } IsBusy = true; try { // Thuc hien cong viec tai day var employeeLogic = new EmployeeLogic(_dbContext); if (IsEditing) { if (IsChangingPassword) { await employeeLogic.UpdateAsync(new Employee { Id = EmployeeBindProp.Id, Password = Helper.GetMd5Hash(PasswordBindProp), }); } if (IsChangingInfo) { await employeeLogic.UpdateAsync(new Employee { Id = EmployeeBindProp.Id, FullName = EmployeeBindProp.FullName, Role = EmployeeBindProp.Role }); } await NavigationService.GoBackAsync(); } else { await employeeLogic.CreateAsync(new Employee { Id = EmployeeBindProp.Id, EmployeeName = EmployeeBindProp.EmployeeName, FullName = EmployeeBindProp.FullName, Password = Helper.GetMd5Hash(PasswordBindProp), Role = EmployeeBindProp.Role }); var param = new NavigationParameters(); param.Add(Keys.EMPLOYEE, EmployeeBindProp); await NavigationService.GoBackAsync(param); } } catch (Exception e) { await ShowError(e); } finally { IsBusy = false; } }
protected void Page_Load(object sender, EventArgs e) { EmployeeLogic el = new EmployeeLogic(); Employee e2 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); if (!IsPostBack) { if (!(e2.Designation.Equals("STOCK MANAGER") || e2.Designation.Equals("STOCK EMPLOYEE") || e2.Designation.Equals("ACCOUNTATANT") || e2.Designation.Equals("EMPLOYEE") || e2.Designation.Equals("HR MANAGER") || e2.Designation.Equals("HR EMPLOYEE"))) { CustomerLogic sl = new CustomerLogic(); DropDownList2.DataSource = sl.SelectAll(); DropDownList2.DataTextField = "Name"; DropDownList2.DataValueField = "CustomerID"; DropDownList2.DataBind(); if (Convert.ToInt32(Request.QueryString["id"]) > 0) { // edit mode ProductLogic pl = new ProductLogic(); Product p1 = pl.SelectByProductID(Convert.ToInt32(Request.QueryString["id"])); TextBox1.Text = p1.Name; TextBox2.Text = p1.CreateDate.ToString("dd/MM/yyyy"); DropDownList3.SelectedItem.Text = p1.Status; TextArea1.Text = p1.Description; TextBox4.Text = p1.Size; TextBox5.Text = p1.Colors; String images = p1.DesignFiles; String[] arr = images.Split(new String[] { "#,#" }, StringSplitOptions.RemoveEmptyEntries); if (arr.Length > 0) { FileUpload1.Visible = false; lnkImage1.Text = arr[0].Substring(25); lnkImage1.NavigateUrl = arr[0]; } else { lnkImage1.Visible = false; LinkButton1.Visible = false; } if (arr.Length > 1) { lnkImage2.Text = arr[1].Substring(25); lnkImage2.NavigateUrl = arr[1]; } else { lnkImage2.Visible = false; LinkButton2.Visible = false; } if (arr.Length > 2) { lnkImage3.Text = arr[2].Substring(25); lnkImage3.NavigateUrl = arr[2]; } else { lnkImage3.Visible = false; LinkButton3.Visible = false; } if (arr.Length > 3) { lnkImage4.Text = arr[3].Substring(25); lnkImage4.NavigateUrl = arr[3]; } else { lnkImage4.Visible = false; LinkButton4.Visible = false; } if (arr.Length > 4) { lnkImage5.Text = arr[4].Substring(25); lnkImage5.NavigateUrl = arr[4]; } else { lnkImage5.Visible = false; LinkButton5.Visible = false; } DropDownList1.SelectedItem.Text = p1.Type; Customer s = sl.SelectByID(p1.CustomerID); DropDownList2.SelectedItem.Text = s.Name; } else { lnkImage1.Visible = false; lnkImage2.Visible = false; lnkImage3.Visible = false; lnkImage4.Visible = false; lnkImage5.Visible = false; LinkButton1.Visible = false; LinkButton2.Visible = false; LinkButton3.Visible = false; LinkButton4.Visible = false; LinkButton5.Visible = false; TextBox2.Text = DateTime.Now.ToString("dd/MM/yyyy"); } } else { Response.Redirect("Access.aspx"); } } }
public EmployeeService() { logic = new EmployeeLogic(); }
public void setup() { logic = new EmployeeLogic(); }
protected void Page_Load(object sender, EventArgs e) { if (Session["EmployeeID"] == null) { Response.Redirect("login.aspx"); } if (!IsPostBack) { Session["LastLink"] = Request.Url.PathAndQuery; } EmployeeLogic el = new EmployeeLogic(); Employee e1 = el.SelectByID(Convert.ToInt32(Session["EmployeeID"])); Label1.Text = e1.Name; Image1.ImageUrl = e1.Photo; if (e1.Designation.Equals("MANAGING DIRECTOR")) { MDDiv.Visible = true; } else if (e1.Designation.Equals("MARKETING MANAGER")) { MarketingDiv.Visible = true; } else if (e1.Designation.Equals("MARKETING EMPLOYEE")) { MarketingDiv.Visible = true; } else if (e1.Designation.Equals("DESIGNER")) { DesignerDiv.Visible = true; } else if (e1.Designation.Equals("COMERCIAL MANAGER")) { ComercialDiv.Visible = true; } else if (e1.Designation.Equals("COMERCIAL EMPLOYEE")) { ComercialDiv.Visible = true; } else if (e1.Designation.Equals("STOCK MANAGER")) { StockDiv.Visible = true; } else if (e1.Designation.Equals("STOCK EMPLOYEE")) { StockDiv.Visible = true; } else if (e1.Designation.Equals("PRODUCTION MANAGER")) { ProDiv.Visible = true; } else if (e1.Designation.Equals("PRODUCTION EMPLOYEE")) { ProDiv.Visible = true; } else if (e1.Designation.Equals("HR MANAGER")) { HRDiv.Visible = true; } else if (e1.Designation.Equals("HR EMPLOYEE")) { HRDiv.Visible = true; } else if (e1.Designation.Equals("EMPLOYEE")) { EmpDiv.Visible = true; } else if (e1.Designation.Equals("CHAIRMAN")) { MDDiv.Visible = true; } else if (e1.Designation.Equals("ACCOUNTATANT")) { AccDiv.Visible = true; } DataTable dt = new AttendanceLogic().SelectForAttendanceReport(DateTime.Today); float present = Convert.ToSingle(dt.Rows[0][1]); float absent = Convert.ToSingle(dt.Rows[1][1]); lblPResentPerc.Text = (present * 100) / (present + absent) + ""; attendanceperc.Attributes["aria-valuenow"] = (present * 100) / (present + absent) + ""; attendanceperc.Attributes["style"] = "width: " + ((present * 100) / (present + absent)) + "%"; }
public WindowRegistration(EmployeeLogic logic) { InitializeComponent(); this.logic = logic; }
public MainWindow(EmployeeLogic logic) { InitializeComponent(); this.logic = logic; }
public EmployeeController(EmployeeLogic employeeLogic) { _employeeLogic = employeeLogic; }
/// <summary> /// 通过条件查找员工的请假,加班,外出情况,便于人事后台查看流程流转状态 /// </summary> public List <Request> GetRequestRecordByCondition(string employeeName, int departmentID, int?gradeType, DateTime from, DateTime to, ApplicationTypeEnum applicationType, RequestStatus applicationStatus, Account loginUser) { List <Request> applicationList = new List <Request>(); var list = EmployeeLogic.GetEmployeeBasicInfoByBasicCondition(employeeName, EmployeeTypeEnum.All, -1, gradeType, departmentID, true, HrmisPowers.A509, loginUser.Id, -1, new List <int> { (int)EmployeeTypeEnum.BorrowedEmployee }); List <Employee> employeeList = new List <Employee>(); foreach (var employeeEntity in list) { employeeList.Add(EmployeeEntity.Convert(employeeEntity)); } // new GetEmployee().GetEmployeeBasicInfoByBasicCondition(employeeName, EmployeeTypeEnum.All, -1, departmentID, true, -1, gradeType); //if (departmentID==-1)//如果查全部员工需去掉没有查询权限的员工 //{ // EmployeeList = HrmisUtility.RemoteUnAuthEmployee(EmployeeList, AuthType.HRMIS, loginUser, HrmisPowers.A509); //} for (int i = 0; i < employeeList.Count; i++) { //if (EmployeeList[i] == null || EmployeeList[i].EmployeeType == EmployeeTypeEnum.BorrowedEmployee) //{ // continue; //} //根据入职离职时间确定考勤的有效时间 DateTime employeeFromDate = DateTime.Compare(employeeList[i].EmployeeDetails.Work.ComeDate, from) > 0 ? employeeList[i].EmployeeDetails.Work.ComeDate : from; DateTime employeeToDate; if (employeeList[i].EmployeeType == EmployeeTypeEnum.DimissionEmployee && employeeList[i].EmployeeDetails.Work.DimissionInfo != null) { employeeToDate = DateTime.Compare(employeeList[i].EmployeeDetails.Work.DimissionInfo.DimissionDate, to) < 0 ? employeeList[i].EmployeeDetails.Work.DimissionInfo.DimissionDate : to; } else { employeeToDate = to; } if (DateTime.Compare(employeeFromDate, employeeToDate) > 0) { continue; } employeeList[i].EmployeeAttendance = new EmployeeAttendance(employeeFromDate, employeeToDate); employeeList[i].EmployeeAttendance.PlanDutyDetailList = _DalRull.GetPlanDutyDetailByAccount(employeeList[i].Account.Id, employeeFromDate, employeeToDate); //没有考勤规则的人不会这里出现 if (employeeList[i].EmployeeAttendance.PlanDutyDetailList == null || employeeList[i].EmployeeAttendance.PlanDutyDetailList.Count == 0) { continue; } List <Request> applicationListTemp = new List <Request>(); switch (applicationType) { case ApplicationTypeEnum.All: applicationListTemp.AddRange( GetRequestFromLeaveRequest(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus)); applicationListTemp.AddRange( GetRequestFromOutApplication(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus, OutType.All)); applicationListTemp.AddRange( GetRequestFromOverWork(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus)); break; case ApplicationTypeEnum.LeaveRequest: applicationListTemp.AddRange( GetRequestFromLeaveRequest(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus)); break; case ApplicationTypeEnum.InCityOut: applicationListTemp.AddRange( GetRequestFromOutApplication(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus, OutType.InCity)); break; case ApplicationTypeEnum.OutCityOut: applicationListTemp.AddRange( GetRequestFromOutApplication(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus, OutType.OutCity)); break; case ApplicationTypeEnum.TrainOut: applicationListTemp.AddRange( GetRequestFromOutApplication(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus, OutType.Train)); break; case ApplicationTypeEnum.OverTime: applicationListTemp.AddRange( GetRequestFromOverWork(employeeList[i].Account.Id, employeeList[i].EmployeeAttendance.FromDate, employeeList[i].EmployeeAttendance.ToDate, applicationStatus)); break; default: break; } foreach (Request request in applicationListTemp) { request.Account.Name = employeeList[i].Account.Name; } applicationList.AddRange(applicationListTemp); } return(applicationList); }