private void ShowInfo(int _id) { BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(_id); txtTitle.Text = model.title; rblIsLock.SelectedValue = model.is_lock.ToString(); txtDepart.Text = model.depart; txtNumber.Text = model.number.ToString(); ddlSex.SelectedValue = model.sex; txtExperience.Text = model.experience; txtEducation.Text = model.education; txtAge.Text = model.age; txtProfession.Text = model.profession; txtWork_area.Text = model.work_area; txtStart_time.Text = model.start_time; txtEnd_time.Text = model.end_time; txtContent.Value = model.Content; txtClick.Text = model.click.ToString(); txtSortId.Text = model.sort_id.ToString(); txtContactName.Text = model.ContactName; txtPhone.Text = model.Phone; txtFax.Text = model.Fax; txtEmail.Text = model.Fax; txtAddress.Text = model.Address; }
private void RptBind(string _strWhere, string _orderby) { this.txtKeywords.Text = this.keywords; BLL.job bll = new BLL.job(); this.rptList.DataSource = bll.GetList(0, _strWhere, _orderby); this.rptList.DataBind(); }
private bool InsertJob(MODEL.Criteria.job job, List <MODEL.Criteria.jobDetail> lstJobDetail) { BLL.job _BLL = new BLL.job(); int ret; ret = _BLL.Insert_Job(job); if (ret == 1) { int k; k = lstJobDetail.Count(); for (int i = 0; i < k; i++) { MODEL.Criteria.jobDetail jdt = new MODEL.Criteria.jobDetail(); jdt = (MODEL.Criteria.jobDetail)lstJobDetail[i]; jdt.job_id = job.job_id; jdt.job_name = job.job_name; _BLL.Insert_JobDetail(jdt); } } return(true); }
private bool DoAdd() { ChkAdminLevel("plugin_job", DTEnums.ActionEnum.Add.ToString()); //检查权限 bool result = true; Model.job model = new Model.job(); BLL.job bll = new BLL.job(); model.title = txtTitle.Text.Trim(); model.depart = txtDepart.Text.Trim(); model.sex = ddlSex.SelectedValue; model.number = int.Parse(txtNumber.Text.Trim()); model.education = txtEducation.Text.Trim(); model.age = txtAge.Text.Trim(); model.profession = txtProfession.Text.Trim(); model.experience = txtExperience.Text.Trim(); model.work_area = txtWork_area.Text.Trim(); model.start_time = txtStart_time.Text.Trim(); model.end_time = txtEnd_time.Text.Trim(); model.Content = txtContent.Value.Trim(); model.ContactName = txtContactName.Text.Trim(); model.Phone = txtPhone.Text.Trim(); model.Fax = txtFax.Text.Trim(); model.Email = txtEmail.Text.Trim(); model.Address = txtAddress.Text.Trim(); model.click =int.Parse(txtClick.Text.Trim()); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (!bll.Add(model)) { result = false; } return result; }
protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "print_barcode") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; DataTable dt; BLL.job _BLL = new BLL.job(); dt = _BLL.getData_ReportJob(job_id); Session["DATATABLE"] = dt; //Model.Log L = new Model.Log(); //Helper.Utility Log = new Helper.Utility(); //L.content = "Go to SendMailApprove.aspx."; //L.create_by = Session["EMAIL"].ToString(); //Log.WriteLog(L); Response.Redirect("/Report/rpt_Job.aspx"); } if (e.CommandName == "timestamp2") { Timer1.Enabled = false; txtTime.Text = DateTime.Now.ToString("hh:mm:ss"); this.ModalPopupExtender1.Show(); // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none","<script>alert('test');</script>", false); } }
protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "print_barcode") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; DataTable dt; BLL.job _BLL = new BLL.job(); dt = _BLL.getData_ReportJob(job_id); Session["DATATABLE"] = dt; //Model.Log L = new Model.Log(); //Helper.Utility Log = new Helper.Utility(); //L.content = "Go to SendMailApprove.aspx."; //L.create_by = Session["EMAIL"].ToString(); //Log.WriteLog(L); Response.Redirect("/Report/rpt_Job.aspx"); } if (e.CommandName == "timestamp2") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; ImageButton myImageButton1 = grid.Rows[idx].FindControl("timestamp1") as ImageButton; Timer1.Enabled = false; lbl_job_id.Text = job_id; Session["JOB_ID"] = job_id; // DateTime dt = DateTime.Parse("12:35 PM"); DateTime dt = DateTime.Now; MKB.TimePicker.TimeSelector.AmPmSpec am_pm; if (dt.ToString("tt") == "AM") { am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.AM; } else { am_pm = MKB.TimePicker.TimeSelector.AmPmSpec.PM; } // TimeSelector1.SetTime(dt.Hour, dt.Minute, am_pm); if (myImageButton1.ImageUrl == "Images/check.png") { this.ModalPopupExtender1.Show(); } // ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "none","<script>alert('test');</script>", false); } }
protected string GetJobName(int jobId) { BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(jobId); if (model == null) return ""; return model.title; }
protected void grid_RowCommand(object sender, GridViewCommandEventArgs e) { if (e.CommandName == "print_barcode") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; DataTable dt; BLL.job _BLL = new BLL.job(); dt = _BLL.getData_ReportJob(job_id); Session["DATATABLE"] = dt; //Model.Log L = new Model.Log(); //Helper.Utility Log = new Helper.Utility(); //L.content = "Go to SendMailApprove.aspx."; //L.create_by = Session["EMAIL"].ToString(); //Log.WriteLog(L); Response.Redirect("~/Report/rpt_Job.aspx"); } if (e.CommandName == "REPORT") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; DataTable dt; BLL.job _BLL = new BLL.job(); dt = _BLL.getData_ReportJobTimestamp(job_id); Session["DATATABLE"] = dt; //Model.Log L = new Model.Log(); //Helper.Utility Log = new Helper.Utility(); //L.content = "Go to SendMailApprove.aspx."; //L.create_by = Session["EMAIL"].ToString(); //Log.WriteLog(L); Response.Redirect("~/Report/rpt_job_report.aspx"); } if (e.CommandName == "DELETE") { int idx = Convert.ToInt32(e.CommandArgument); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; BLL.job _BLL = new BLL.job(); _BLL.Delete_Job(job_id); } }
protected string GetJobName(int jobId) { BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(jobId); if (model == null) { return(""); } return(model.title); }
protected void btnReportAll_Click(object sender, ImageClickEventArgs e) { BLL.job _BLL = new BLL.job(); //Model.Log L = new Model.Log(); //Helper.Utility Log = new Helper.Utility(); //L.content = "Go to SendMailApprove.aspx."; //L.create_by = Session["EMAIL"].ToString(); //Log.WriteLog(L); Response.Redirect("~/Report/rpt_job_report.aspx"); }
protected void grid_RowDeleting(object sender, GridViewDeleteEventArgs e) { int idx = Convert.ToInt32(e.RowIndex); GridViewRow Row = grid.Rows[idx]; string job_id; job_id = Row.Cells[1].Text; BLL.job _BLL = new BLL.job(); _BLL.Delete_Job(job_id); BindGrid(); }
//批量删除 protected void btnDelete_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_job", DTEnums.ActionEnum.Delete.ToString()); //检查权限 BLL.job bll = new BLL.job(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); CheckBox cb = (CheckBox)rptList.Items[i].FindControl("chkId"); if (cb.Checked) { bll.Delete(id); } } JscriptMsg("批量删除成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//保存排序 protected void btnSave_Click(object sender, EventArgs e) { ChkAdminLevel("plugin_job", DTEnums.ActionEnum.Edit.ToString()); //检查权限 BLL.job bll = new BLL.job(); for (int i = 0; i < rptList.Items.Count; i++) { int id = Convert.ToInt32(((HiddenField)rptList.Items[i].FindControl("hidId")).Value); int sortId; if (!int.TryParse(((TextBox)rptList.Items[i].FindControl("txtSortId")).Text.Trim(), out sortId)) { sortId = 99; } bll.UpdateField(id, "sort_id=" + sortId.ToString()); } JscriptMsg("保存排序成功啦!", Utils.CombUrlTxt("index.aspx", "keywords={0}", this.keywords), "Success"); }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) { bll.UpdateField(id, "is_lock=0"); } else { bll.UpdateField(id, "is_lock=1"); } break; } this.RptBind("id>0" + CombSqlTxt(this.keywords), "sort_id asc,id desc"); }
private bool DoEdit(int _id) { ChkAdminLevel("plugin_job", DTEnums.ActionEnum.Edit.ToString()); //检查权限 bool result = true; BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(_id); model.title = txtTitle.Text.Trim(); model.depart = txtDepart.Text.Trim(); model.sex = ddlSex.SelectedValue; model.number = int.Parse(txtNumber.Text.Trim()); model.education = txtEducation.Text.Trim(); model.age = txtAge.Text.Trim(); model.profession = txtProfession.Text.Trim(); model.experience = txtExperience.Text.Trim(); model.work_area = txtWork_area.Text.Trim(); model.start_time = txtStart_time.Text.Trim(); model.end_time = txtEnd_time.Text.Trim(); model.Content = txtContent.Value.Trim(); model.ContactName = txtContactName.Text.Trim(); model.Phone = txtPhone.Text.Trim(); model.Fax = txtFax.Text.Trim(); model.Email = txtEmail.Text.Trim(); model.Address = txtAddress.Text.Trim(); model.click = int.Parse(txtClick.Text.Trim()); model.sort_id = int.Parse(txtSortId.Text.Trim()); model.is_lock = int.Parse(rblIsLock.SelectedValue); model.add_time = DateTime.Now; if (!bll.Update(model)) { result = false; } return(result); }
protected void btnUpdate_Click(object sender, EventArgs e) { string date_ = DateTime.Now.ToString("yyyy-MM-dd"); // string AmPm = TimeSelector1.AmPm.ToString(); string H = "00"; //if (AmPm == "AM") //{ // switch (TimeSelector1.Hour) // { // case 1: // H = "01"; // break; // case 2: // H = "02"; // break; // case 3: // H = "03"; // break; // case 4: // H = "04"; // break; // case 5: // H = "05"; // break; // case 6: // H = "06"; // break; // case 7: // H = "07"; // break; // case 8: // H = "08"; // break; // case 9: // H = "09"; // break; // case 10: // H = "10"; // break; // case 11: // H = "11"; // break; // case 12: // H = "12"; // break; // } //} //if (AmPm == "PM") //{ // switch (TimeSelector1.Hour) // { // case 1: // H = "13"; // break; // case 2: // H = "14"; // break; // case 3: // H = "15"; // break; // case 4: // H = "16"; // break; // case 5: // H = "17"; // break; // case 6: // H = "18"; // break; // case 7: // H = "19"; // break; // case 8: // H = "20"; // break; // case 9: // H = "21"; // break; // case 10: // H = "22"; // break; // case 11: // H = "23"; // break; // } //} // string strTime = date_ + " " + H + ":" + TimeSelector1.Minute + ":00"; BLL.job _BLL = new BLL.job(); if (lbl_job_id.Text == "") { lbl_job_id.Text = Session["JOB_ID"].ToString(); } // _BLL.Update_stamp2(strTime, lbl_job_id.Text); // Timer1.Enabled = true; }
protected void btnUpdate_Click(object sender, EventArgs e) { string[] arrHH = null; string date_ = DateTime.Now.ToString("yyyy-MM-dd"); string strHH = txtHH.Text; if (strHH != "") { bool res; res = strHH.Contains(":"); if (!res) { Response.Write("<script>alert('โปรดใส่ Format HH:mm')</script>"); return; } else { arrHH = strHH.Split(':'); int n; bool isNumeric = int.TryParse(arrHH[0], out n); if (!isNumeric) { Response.Write("<script>alert('โปรดใส่ Format HH:mm')</script>"); return; } bool isNumeric2 = int.TryParse(arrHH[1], out n); if (!isNumeric2) { Response.Write("<script>alert('โปรดใส่ Format HH:mm')</script>"); return; } } } //string AmPm = TimeSelector1.AmPm.ToString(); //string H = "00"; //if (AmPm == "AM") //{ // switch (TimeSelector1.Hour) // { // case 1: // H = "01"; // break; // case 2: // H = "02"; // break; // case 3: // H = "03"; // break; // case 4: // H = "04"; // break; // case 5: // H = "05"; // break; // case 6: // H = "06"; // break; // case 7: // H = "07"; // break; // case 8: // H = "08"; // break; // case 9: // H = "09"; // break; // case 10: // H = "10"; // break; // case 11: // H = "11"; // break; // case 12: // H = "12"; // break; // } //} //if(AmPm == "PM") //{ // switch(TimeSelector1.Hour) // { // case 1 : // H = "13"; // break; // case 2 : // H = "14"; // break; // case 3: // H = "15"; // break; // case 4: // H = "16"; // break; // case 5: // H = "17"; // break; // case 6: // H = "18"; // break; // case 7: // H = "19"; // break; // case 8: // H = "20"; // break; // case 9: // H = "21"; // break; // case 10: // H = "22"; // break; // case 11: // H = "23"; // break; // } //} string strTime = date_ + " " + arrHH[0] + ":" + arrHH[1] + ":00"; BLL.job _BLL = new BLL.job(); if (lbl_job_id.Text == "") { lbl_job_id.Text = Session["JOB_ID"].ToString(); } _BLL.Update_stamp2(strTime, lbl_job_id.Text); Timer1.Enabled = true; }
//protected void txtBarcode_TextChanged(object sender, EventArgs e) //{ // string barcode = txtBarcode.Text; // stamp_1(barcode); // string sql = "Select * from job_trailer where job_id = " + barcode; // DataTable dt; // dt = GetData(sql); // grid.DataSource = dt; // grid.DataBind(); //} protected void stamp_1(string job_id) { BLL.job _BLL = new BLL.job(); _BLL.Update_stamp1(job_id); }
//设置操作 protected void rptList_ItemCommand(object source, RepeaterCommandEventArgs e) { int id = Convert.ToInt32(((HiddenField)e.Item.FindControl("hidId")).Value); BLL.job bll = new BLL.job(); Model.job model = bll.GetModel(id); switch (e.CommandName.ToLower()) { case "ibtnlock": if (model.is_lock == 1) bll.UpdateField(id, "is_lock=0"); else bll.UpdateField(id, "is_lock=1"); break; } this.RptBind("id>0" + CombSqlTxt(this.keywords), "sort_id asc,id desc"); }
protected void txtBarcode_TextChanged(object sender, EventArgs e) { string barcode = txtBarcode.Text; //GET STATUS BARCODE IF STATUS 1 CALL Stamp1 //STATUS 2 (stamp1 && stamp2 = true) CALL stamp3 //STATUS 3 CALL stamp4 int retStatus; BLL.job _BLL = new BLL.job(); retStatus = _BLL.GetStatus_Barcode(barcode); switch (retStatus) { case 1: _BLL.Update_stamp1(barcode); break; case 2: _BLL.Update_stamp3(barcode); Session["TIME"] = DateTime.Now; break; case 3: if (Session["TIME"] != null) { DateTime dt2 = (DateTime)Session["TIME"]; DateTime dt3 = DateTime.Now; TimeSpan span; span = dt3.Subtract(dt2); if (span.Minutes > 1) { _BLL.Update_stamp4(barcode); } } else { _BLL.Update_stamp4(barcode); } break; } txtBarcode.Text = ""; BindGrid(); // string sql = "Select * from job_trailer where job_id = " + barcode; // DataTable dt; //dt = GetData(sql); //grid.DataSource = dt; //grid.DataBind(); }