public JsonResult UpdateAdmin(Models.AdminModel model) { if (ModelState.IsValid) { IDAL.IAdminRepository adminRepository = EnterRepository.GetRepositoryEnter().GetAdminRepository; //判断权限名称是否已存在 var result = adminRepository.LoadEntities(m => m.Mobile == model.Mobile.Trim()).FirstOrDefault(); if (result != null && result.Id != model.Id) { return(Json(new { state = "error", message = "手机号码已经存在了" })); } else { Model.Admin admin = new Model.Admin() { AuthoryId = model.AuthoryId, IsLogin = model.IsLogin, AdminName = model.AdminName, Mobile = model.Mobile, Id = model.Id }; //清楚context中result对象 adminRepository.Get(m => m.Id == model.Id); adminRepository.EditEntity(admin, new string[] { "AuthoryId", "IsLogin", "Mobile", "AdminName" }); PublicFunction.AddOperation(1, string.Format("修改管理员"), string.Format("修改管理员=={0}==成功", model.Mobile)); if (EnterRepository.GetRepositoryEnter().SaveChange() > 0) { return(Json(new { state = "success", message = "修改管理员成功" })); } else { PublicFunction.AddOperation(1, string.Format("修改管理员"), string.Format("修改管理员=={0}==失败", model.Mobile)); EnterRepository.GetRepositoryEnter().SaveChange(); return(Json(new { state = "error", message = "修改管理员失败" })); } } } else { return(Json(new { state = "error", message = "信息不完整" })); } }
private void frmTaSecurityByDep_Load(object sender, System.EventArgs e) { string sql; sql = "Delete from SYS_SECURITY_DEP where DEP_ID not in (Select DEP_ID from FILA02A )"; PublicFunction.SQL_Execute(sql); sql = "Delete from SYS_SECURITY_DEP where USER_ID not in (Select USER_ID from SYS_USER )"; PublicFunction.SQL_Execute(sql); sql = "Delete from SYS_SECURITY_DEP where MNU_ID not in (Select ID as MNU_ID from SYS_MENU where DEP_BT=1)"; PublicFunction.SQL_Execute(sql); nav.cmd_copy.Visible = false; nav.cmd_report.Visible = false; nav.cmd_search.Visible = false; PublicFunction.InitNav(this, vs, nav); nav.Show_VS("GROUP_ID=N'" + GROUP_ID + "'"); vs1.Cols.Count = 3; vs1.Cols[1].Name = "DEP_NM"; vs1.Cols[0].Name = "DEP_ID"; vs1.Cols[0].Visible = false; vs1.Cols[2].Name = "ALL_BT"; vs1.Cols[1].AllowEditing = false; vs1.Cols[2].DataType = typeof(System.Boolean); vs1.Tree.Column = 1; PublicFunction.L_Init_Label(this); nav1.form = this; nav1.TBarClick += new ToolBarButtonClickEventHandler(nav1_TBarClick); nav1.cmd_add.Visible = nav1.cmd_copy.Visible = nav1.cmd_delete.Visible = nav1.cmd_fisrt.Visible = nav1.cmd_last.Visible = nav1.cmd_next.Visible = nav1.cmd_previous.Visible = nav1.cmd_refresh.Visible = nav1.cmd_report.Visible = nav1.cmd_refresh.Visible = nav1.cmd_search.Visible = false; Init_Tree(); edit = false; vs.AfterRowColChange += new RangeEventHandler(vs_AfterRowColChange); vs1.AfterEdit += new RowColEventHandler(vs1_AfterEdit); vs1.DoubleClick += new EventHandler(vs1_DoubleClick); label5.Text = label5.Text + " - " + label; this.Text = label5.Text; for (int i = 1; i < vs.Rows.Count; i++) { if ((vs.Rows[i]["USER_ID"] + "").ToUpper() == PublicFunction.A_UserID.ToUpper()) { vs.Row = i; break; } } }
private void nav_TBarClick(object sender, ToolBarButtonClickEventArgs e) { if (e.Button.Equals(nav.cmd_add)) { frmTaAddColPayroll dlg = new frmTaAddColPayroll(); if (dlg.ShowDialog() == DialogResult.OK) { nav.Show_VS("1=1 order by SEQ_NO"); } return; } if (e.Button.Equals(nav.cmd_delete)) { if (vs.Rows[vs.Row]["LCK_BT"] + "" == "True") { MessageBox.Show(PublicFunction.L_Get_Msg("msg", 178)); return; } if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 92) + " [" + vs.Rows[vs.Row]["COL_NM"] + "]?", this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 93) + "", this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { string sCol = vs.Rows[vs.Row]["COL_NM"].ToString(); if (nav.DeleteRow(vs.Row, false)) { try { DropColumn("FILD02A", sCol); DropColumn("FILD03A", sCol); DropColumn("FILA19A", sCol); } catch (SqlException ex) { MessageBox.Show(ex.Message); } } } } return; } if (e.Button.Equals(nav.cmd_save)) { for (int i = 1; i < vs.Rows.Count; i++) { vs.Rows[i]["SEQ_NO"] = i; vs.Rows[i].UserData = 1; } } nav.ToolBar_Click(e); }
public JsonResult AddRole(Models.RoleModel model) { if (ModelState.IsValid) { IDAL.IAuthoryRepository authoryRepository = EnterRepository.GetRepositoryEnter().GetAuthoryRepository; //判断权限名称是否已存在 var result = authoryRepository.LoadEntities(m => m.Name == model.Name.Trim()).FirstOrDefault(); if (result == null) { authoryRepository.AddEntity(new Model.Authory() { Intro = model.Intro, Name = model.Name, OrderNum = model.OrderNum, State = model.State }); //添加下操作记录 PublicFunction.AddOperation(1, string.Format("添加角色"), string.Format("添加角色=={0}==成功", model.Name)); if (EnterRepository.GetRepositoryEnter().SaveChange() > 0) { return(Json(new { state = "success", message = "添加角色成功" })); } else { PublicFunction.AddOperation(1, string.Format("添加角色"), string.Format("添加角色=={0}==失败", model.Name)); EnterRepository.GetRepositoryEnter().SaveChange(); return(Json(new { state = "error", message = "添加角色失败" })); } } else { return(Json(new { state = "error", message = "角色名称已经存在了" })); } } else { return(Json(new { state = "error", message = "信息不完整" })); } }
private void cmd_ok_Click(object sender, System.EventArgs e) { if (cb.SelectedValue + "" == "") { MessageBox.Show(PublicFunction.L_Get_Msg("POS", 10)); return; } if (MessageBox.Show(this, PublicFunction.L_Get_Msg("msg", 13), this.Text, MessageBoxButtons.YesNo) == DialogResult.Yes) { SqlConnection con = new SqlConnection(PublicFunction.C_con.ConnectionString); con.Open(); SqlTransaction tran = con.BeginTransaction(); try { string sql = ""; sql = "Insert Into FILB01AC(EMP_ID,VAC_ID,VAC_DT,NOT_DR,BLT_NM,BLT_DT,VAT_BT) values(" + "N'" + EMP_ID.Text + "'," + "N'" + cb.SelectedValue + "'," + "'" + ((DateTime)dt.Value).ToString("yyyy/MM/dd") + "'," + "N'" + txt_note.Text + "',N'" + PublicFunction.A_UserID + "','" + T_String.GetDate().ToString("yyyy/MM/dd HH:mm") + "',"; if (T_String.IsNullTo0(T_String.GetDate().ToString("yyyyMMdd")) >= T_String.IsNullTo0(((DateTime)dt.Value).ToString("yyyyMMdd"))) { sql += "0)"; } else { sql += "1)"; } SqlCommand cmd = new SqlCommand(sql, con, tran); cmd.ExecuteNonQuery(); if (T_String.IsNullTo0(T_String.GetDate().ToString("yyyyMMdd")) >= T_String.IsNullTo0(((DateTime)dt.Value).ToString("yyyyMMdd"))) { sql = "Update FILB01A set VAC_BT=1,CRD_NO='' where EMP_ID=N'" + EMP_ID.Text + "'"; cmd = new SqlCommand(sql, con, tran); cmd.ExecuteNonQuery(); } tran.Commit(); } catch (Exception ex) { tran.Rollback(); MessageBox.Show(ex.Message); return; } MessageBox.Show(PublicFunction.L_Get_Msg("Staff", 1)); con.Close(); DialogResult = DialogResult.OK; } }
public static async void ImportCourseData() { Dictionary <string, int> CourseData = PublicFunction.GetCourseData(); Dictionary <string, int> GroupData = PublicFunction.GetGroupData(); Dictionary <string, int> DepartmentData = PublicFunction.GetDepartmentData(); var values = new Dictionary <string, string> { { "login", "report" }, { "pass", "RKXMSDrkxmsd123" }, { "sec", "8B31DE7909" }, { "Pub", "<Root></Root>" }, { "pri", "<Root><N UQID=\"324\" id=\"2\" F=\"0\" T=\"\" /></Root>" }, { "mor", "" }, { "iFID", "1133" } }; var url = string.Format("https://golestan.qiet.ac.ir/GolestanService/gservice.asmx/golInfo?{0}", string.Join("&", values.Select(kvp => string.Format("{0}={1}", kvp.Key, kvp.Value)))); try { int Count = 0; // string Group= this.Group.Text; string a = await client.GetStringAsync(url); XmlDocument d = new XmlDocument(); d.LoadXml(a); string query = ""; XmlNodeList XN = d.SelectNodes("/Root/p"); foreach (XmlNode x in XN) { try { if (!CourseData.ContainsKey(x.Attributes[0].Value)) { string temp1 = x.Attributes[0].Value; query += " Insert into CAS_Course values(N'" + x.Attributes["c2"].Value + "','" + temp1.Substring(0, temp1.IndexOf('-')) + "'," + GroupData[x.Attributes["c3"].Value].ToString() + "," + DepartmentData[x.Attributes["c4"].Value].ToString() + ",3,1)"; } } catch (Exception ex) { Count--; } } PublicFunction.d.ExecQuery(query); } catch (Exception ex) { } }
private void cmd_ok_Click(object sender, System.EventArgs e) { // label5.Text="....is running!!!"; // panel2.Enabled=false; string st = "", sql = "", sql1 = "", sql2 = "", where1 = "", where2 = ""; where1 = ((DateTime)dt_dt1.Value).ToString("yyyy/MM/dd"); where2 = ((DateTime)dt_dt2.Value).ToString("yyyy/MM/dd"); st = control1.GetWhere("b", false); sql = string.Format("UPDATE {0} SET USR_CK='", Function.Common.Ints.tbChamCong) + PublicFunction.A_UserID + string.Format("',LOC_B1=1 from FILB01A b where {0}.EMP_ID=b.EMP_ID ", Function.Common.Ints.tbChamCong) + "AND (LOC_B1=0 or LOC_B1 IS NULL) and " + st + " AND ATT_DT>='" + where1 + "' AND ATT_DT<='" + where2 + "'"; where1 = ((DateTime)dt_dt1.Value).ToString("yyyyMM"); where2 = ((DateTime)dt_dt2.Value).ToString("yyyyMM"); sql1 = string.Format("UPDATE {0} SET LST_NM='", Function.Common.Ints.tbTongKet) + PublicFunction.A_UserID + "',LST_DT='" + T_String.GetDate().ToString("yyyy/MM/dd HH:mm") + "',LOC_B1=1" + string.Format(" from FILB01A b where {0}.EMP_ID=b.EMP_ID and ", Function.Common.Ints.tbTongKet) + st + " AND ISNULL(LOC_B1,0)=0 and YYY_MM>='" + where1 + "' AND YYY_MM<='" + where2 + "'"; sql2 = string.Format("UPDATE {0} SET LST_NM='", Function.Common.Ints.tbLuongTD) + PublicFunction.A_UserID + "',LST_DT='" + T_String.GetDate().ToString("yyyy/MM/dd HH:mm") + string.Format("',{0}.LCK_BT=1", Function.Common.Ints.tbLuongTD) + string.Format(" from FILB01A b where {0}.EMP_ID=b.EMP_ID and ", Function.Common.Ints.tbLuongTD) + st + string.Format(" AND ISNULL({0}.LCK_BT,0)=0 and YYY_MM>='", Function.Common.Ints.tbLuongTD) + where1 + "' AND YYY_MM<='" + where2 + "'"; if (rdatt.Checked) { PublicFunction.SQL_Execute(sql); } if (rdaddup.Checked) { PublicFunction.SQL_Execute(sql1); where1 = DateTime.Parse(((DateTime)dt_dt1.Value).ToString("yyyy/MM") + "/01").ToString("yyyy/MM/dd"); where2 = DateTime.Parse(((DateTime)dt_dt2.Value).ToString("yyyy/MM") + "/01").AddMonths(1).AddDays(-1).ToString("yyyy/MM/dd"); sql = string.Format("UPDATE {0} SET USR_CK='", Function.Common.Ints.tbChamCong) + PublicFunction.A_UserID + string.Format("',LOC_B1=1 from FILB01A b where {0}.EMP_ID=b.EMP_ID ", Function.Common.Ints.tbChamCong) + "AND (LOC_B1=0 or LOC_B1 IS NULL) and " + st + " AND ATT_DT>='" + where1 + "' AND ATT_DT<='" + where2 + "'"; PublicFunction.SQL_Execute(sql); } if (rdsalary.Checked) { PublicFunction.SQL_Execute(sql2); PublicFunction.SQL_Execute(sql1); where1 = DateTime.Parse(((DateTime)dt_dt1.Value).ToString("yyyy/MM") + "/01").ToString("yyyy/MM/dd"); where2 = DateTime.Parse(((DateTime)dt_dt2.Value).ToString("yyyy/MM") + "/01").AddMonths(1).AddDays(-1).ToString("yyyy/MM/dd"); sql = string.Format("UPDATE {0} SET USR_CK='", Function.Common.Ints.tbChamCong) + PublicFunction.A_UserID + string.Format("',LOC_B1=1 from FILB01A b where {0}.EMP_ID=b.EMP_ID ", Function.Common.Ints.tbChamCong) + "AND (LOC_B1=0 or LOC_B1 IS NULL) and " + st + " AND ATT_DT>='" + where1 + "' AND ATT_DT<='" + where2 + "'"; PublicFunction.SQL_Execute(sql); } MessageBox.Show("......Finished!!!!!!!!!"); }
private void Init_vs() { vs.Cols.Count = 7; vs.Cols[1].Name = "EMP_ID"; vs.Cols[2].Name = "EMP_I1"; vs.Cols[3].Name = "EMP_NM"; vs.Cols[4].Name = "DEP_ID"; vs.Cols[5].Name = "DT"; vs.Cols[6].Name = "SHI_ID"; vs.Rows.Count = 1; string sql = PublicFunction.GetDep(this.Tag + ""); vs.Cols["DEP_ID"].DataMap = PublicFunction.InitCBForVS(sql); }
private void Transfer() { cmd_tran.Enabled = control1.Enabled = false; int SEQ_NO = 1; if (r2.Checked) { SEQ_NO = 2; } SqlConnection con = new SqlConnection(PublicFunction.C_con.ConnectionString); if (con.State == ConnectionState.Closed) { con.Open(); } string sql = "", dt = T_String.GetDate().ToString("yyyy/MM/dd HH:mm"); control1.Enabled = true; sql = "Select a.EMP_ID,EMP_NM,b.DEP_ID "; for (int j = 1; j < vs.Rows.Count; j++) { if (vs.Rows[j]["COL"] + "" == "True") { sql += ",[" + vs.Rows[j]["COL_NM"] + "]"; } } sql += " from FILD02A a,FILB01A b where a.EMP_ID=b.EMP_ID and " + control1.GetWhere("b", true) + " and SEQ_NO=" + SEQ_NO + " and YYY_MM=N'" + dt1.Text + "'"; Func.RecordSet rs = new Func.RecordSet(sql, con); for (int i = 0; i < rs.rows; i++) { c1.Text = rs.record(i, "EMP_ID") + "_" + rs.record(i, "EMP_NM") + " _ " + (i + 1) + "/" + rs.rows + "_" + ((int)(i + 1) * 100 / rs.rows) + "%"; for (int j = 1; j < vs.Rows.Count; j++) { if (vs.Rows[j]["COL"] + "" == "True") { sql = "update FILD02A set [" + vs.Rows[j]["COL_NM"] + "]=" + T_String.IsNullTo00(rs.record(i, vs.Rows[j]["COL_NM"] + "")) + " where ([" + vs.Rows[j]["COL_NM"] + "]=0 or" + " [" + vs.Rows[j]["COL_NM"] + "] is null ) and EMP_ID=N'" + rs.record(i, "EMP_ID") + "' and YYY_MM=N'" + dt2.Text + "' and SEQ_NO=" + SEQ_NO; PublicFunction.SQL_Execute(sql, con); } } pro1.Value = ((int)(i + 1) * 100 / rs.rows); } cmd_tran.Enabled = control1.Enabled = true; con.Close(); MessageBox.Show(PublicFunction.L_Get_Msg("Staff", 1)); }
public PDUISelect() { InitializeComponent(); InitChoiceList(); //LoadEvent(); InitNet(); InitUI(); manager.DUILiteLogInit(); DataContext = App.DUIManager.OutResult; VoiceList = GetVoiceList(); RadioButton rbt = this.FindName(ChoiceList[PublicFunction.intParse(cmb_GeneralSpeaker.SelectedValue)]) as RadioButton; rbt.IsChecked = true; }
private void cmd_ok_Click(object sender, System.EventArgs e) { string sql; string d1 = dt2.Text; string d4 = dt4.Text; SqlConnection con = new SqlConnection(PublicFunction.C_con.ConnectionString); con.Open(); string insert = "Insert Into FILC03A(EMP_ID,YYY_MM,BLT_NM,BLT_DT,LST_NM,LST_DT"; string dt = T_String.GetDate().ToString("yyyy/MM/dd HH:mm"); for (int i = 1; i <= 31; i++) { insert += ",DAY_" + i.ToString("00"); } insert += ") Select "; for (int i = 1; i < vs1.Rows.Count; i++) { if (vs1.Rows[i]["EMP_ID"] + "" != EMP_ID.Text) { SqlTransaction tran = con.BeginTransaction(); try { sql = "Delete From FILC03A where YYY_MM='" + d4 + "' and EMP_ID=N'" + vs1.Rows[i]["EMP_ID"] + "'"; SqlCommand cmd = new SqlCommand(sql, con, tran); cmd.ExecuteNonQuery(); sql = "N'" + vs1.Rows[i]["EMP_ID"] + "' as EMP_ID" + ",N'" + d4 + "' as YYY_MM" + ",N'" + PublicFunction.A_UserID + "' as BLT_NM " + ",'" + dt + "' as BLT_DT " + ",N'" + PublicFunction.A_UserID + "' as LST_NM " + ",'" + dt + "' as LST_DT "; for (int j = 1; j <= 31; j++) { sql += ",DAY_" + j.ToString("00"); } sql = insert + sql + " from FILC03A where YYY_MM='" + d1 + "' and EMP_ID=N'" + vs1.Rows[i]["EMP_ID"] + "'"; cmd = new SqlCommand(sql, con, tran); cmd.ExecuteNonQuery(); tran.Commit(); } catch (Exception ex) { tran.Rollback(); MessageBox.Show(ex.Message); } } } MessageBox.Show(PublicFunction.L_Get_Msg("Staff", 1)); }
private void frmTaHRReport_Load(object sender, System.EventArgs e) { PublicFunction.InitNav(this, vs, nav); vs.EnabledChanged += new EventHandler(vs_EnabledChanged); Basic.Function.PublicFunction.L_Init_Label(this); nav.Show_VS("[NAME]=N'ACC_" + PublicFunction.CUS_ID + "' or [NAME]=N'ACC_0'"); dt_dt1.CustomFormat = dt_dt2.CustomFormat = PublicFunction.GetOption("DATE"); control1.InitCB(this.Tag); control1.Initlabel(); vs.AfterRowColChange += new C1.Win.C1FlexGrid.RangeEventHandler(vs_AfterRowColChange); Show_con(); // dt_m.Text=""; dt_m.Value = DateTime.Now; }
private void frmTaCardDataSwitch_Load(object sender, System.EventArgs e) { Basic.Function.PublicFunction.L_Init_Label(this); control1.InitCB(this.Tag); control1.Initlabel(); dt3.Value = T_String.GetDate(); string sql = "Select [ID] as SEQ_NO," + PublicFunction.L_Lag + " from SYS_LABEL where [NAME]=N'frmTaNotesSlip_Type'"; PublicFunction.InitCB(cb, sql, false); sql = "Select COL_NM,COL_" + PublicFunction.L_Lag + " from FILD01A "; PublicFunction.InitCB(cb1, sql, false); }
/// <summary> /// 根据一个IGeometry对象选择一个指定图层上的要素,选择环境为类中使用的SelectOption /// </summary> /// <param name="pFeaLay"></param> /// <param name="pGeometry"></param> public static void FeatureLayerSelect(IFeatureLayer pFeaLay, IGeometry pGeometry) { if (pGeometry == null) { return; } double dis = 10;// PublicFunction.ConvertPixelsToMapUnits(m_ActiveView, m_Option.Tolerate); IGeometry pBuff = PublicFunction.DoBuffer(pGeometry, dis); SpatialFilterClass spaFilter = new SpatialFilterClass(); spaFilter.Geometry = pBuff; spaFilter.SpatialRel = esriSpatialRelEnum.esriSpatialRelIntersects;//交叉 PublicFunction.FeatureLayerSelect(pFeaLay, spaFilter as ISpatialFilter, esriSelectionResultEnum.esriSelectionResultNew); }
private void Init_vs() { nav.cmd_copy.Visible = false; //nav.cmd_delete.Visible=false; nav.cmd_report.Visible = false; nav.cmd_search.Visible = false; nav.cmd_exit.Visible = false; PublicFunction.InitNav(this, vs, nav); vs.EnabledChanged += new EventHandler(vs_EnabledChanged); vs.BeforeEdit += new RowColEventHandler(vs_BeforeEdit); Init_CB(); nav.TBarClick += new ToolBarButtonClickEventHandler(nav_TBarClick); nav.ToolBar_Auto = false; }
private void frmTaCardDataSwitch_Load(object sender, System.EventArgs e) { Basic.Function.PublicFunction.L_Init_Label(this); control1.InitCB(this.Tag); control1.Initlabel(); dt3.Value = dt2.Value = dt1.Value = T_String.GetDate(); dt1.CustomFormat = dt2.CustomFormat = PublicFunction.GetOption("DATE"); string sql = "Select FNAME," + PublicFunction.L_Lag + " from SYS_LABEL where [NAME]=N'frmTaSubsidyCal' and (FName='1' or FName='2')"; //PublicFunction.InitCB(cb,sql,false); chkUpdateSalary.Checked = true; this.Closed += new EventHandler(frmTaSubsidyCal_Closed); cmd_stop.Visible = false; }
private void GetDanhSachNhapSach() { var data = cn.getDataTable("select s.id as 'Mã phiếu',s.ten as 'Tên',ct.soluong as 'Số lượng'" + ",ct.dongia as 'Đơn giá',p.ngaytao as 'Ngày tạo',p.trangthai as 'Trạng thái' from phieu p join loaiphieu l on p.loaiphieuId = l.id join chitietphieu ct on p.id = ct.phieuid join sach s on ct.sachId = s.id" + " where ('" + search + "' = '' or s.ten like N'%" + search + "%') and p.ngaytao >= '" + PublicFunction.GetDate(dateto) + "' and p.ngaytao <= '" + PublicFunction.GetDate(dateFrom) + "'"); dataGridView1.DataSource = data; dataGridView1.Columns[0].Width = 70; dataGridView1.Columns[1].MinimumWidth = 400; dataGridView1.Columns[2].Width = 90; dataGridView1.Columns[3].Width = 150; label4.Text = "Thời gian nhập hàng từ " + PublicFunction.CountDay(dateto, dateFrom) + " ngày trước."; }
private void Init_CB1() { string sql; //Department sql = PublicFunction.GetDep(this.Tag + ""); vs1.Cols["DEP_ID"].DataMap = PublicFunction.InitCBForVS(sql); //Position sql = "Select POS_ID,POS_NM from FILA07A"; vs1.Cols["POS_ID"].DataMap = PublicFunction.InitCBForVS(sql); //Level sql = "Select LEV_ID,LEV_NM from FILA19A"; vs1.Cols["LEV_ID"].DataMap = PublicFunction.InitCBForVS(sql); }
private void Init_vs2() { nav2.cmd_copy.Visible = false; nav2.cmd_report.Visible = false; nav2.cmd_search.Visible = false; nav2.cmd_add.Visible = false; nav2.cmd_exit.Visible = false; PublicFunction.InitNav(this, vs2, nav2); vs2.Cols["CON_C1"].ComboList = vs2.Cols["CON_C2"].ComboList = "=|>|>=|<|<=|like"; vs2.Cols["AND_OR"].ComboList = "AND|OR"; nav2.Show_VS(); nav2.ToolBar_Auto = false; nav2.TBarClick += new ToolBarButtonClickEventHandler(nav2_TBarClick); }
public static string InsertSession(int Srl_Erae, string TermStartDate, string TermEndDate, int Type, string Day, string StartTime, string EndTime) { string[] HolidayList = PublicFunction.GetHolidayData(); string start = TermStartDate; string end = TermEndDate; int WeekCounter = 1; string query = ""; DateTime EndDate = VB_Component.DateFuntion.GetDAte(end); DateTime StartDate = VB_Component.DateFuntion.GetDAte(start); if (StartDate != null && EndDate != null) { while (StartDate <= EndDate) { start = VB_Component.FarsiDateFun.E2F(StartDate); string TempDay = VB_Component.DateFuntion.GetDeyOfWeek(start); // ثابت:2- فرد:1- زوج:0 if (PublicFunction.GetDayNumberFunction(TempDay) == PublicFunction.GetDayNumber(Day) && (WeekCounter % 2 == Type || Type == 2)) { StartDate = StartDate.AddDays(Type == 2 ? 6 : 13); if (!(TempDay == "جمعه") && !HolidayList.Contains(start)) { try { query += " Insert Into CAS_Session values(" + Srl_Erae.ToString() + ",N'" + start + "',N'" + StartTime + "',N'" + EndTime + "',0,0,0) "; //Session s = new Session(); //s.Srl_Erae = Srl_Erae.ToString(); //s.Tarikh = start; //s.StartTime = StartTime; //s.EndTime = EndTime; //s.Type = 0; //s.IsStart = false; //s.Delay = 0; //s.Insert(); } catch { } } } if (StartDate.DayOfWeek == DayOfWeek.Friday) { WeekCounter++; } StartDate = StartDate.AddDays(1); } } return(query); }
private void frmSearch4_Load(object sender, System.EventArgs e) { try { //vs.AllowEditing = true; vs.AutoSearch = AutoSearchEnum.FromCursor; vs.KeyActionTab = KeyActionEnum.MoveDown; vs.TabIndex = 0; vs.SelectionMode = SelectionModeEnum.Row; PublicFunction.L_Init_Label(this); vs.Cols.Count = _Cols + 1; vs.Rows.Count = _rs.rows + 1; for (int c = 1; c < _Cols + 1; c++) { vs.Cols[c].Name = _rs.Field(c - 1); if (vs.Cols[c].Name == "SYS_SEL") { vs.Cols[c].Caption = PublicFunction.L_GetLabel_VS("Public", vs.Cols[c].Name); vs.Cols[c].DataType = typeof(System.Boolean); } else { vs.Cols[c].Caption = PublicFunction.L_GetLabel_VS(_LabelID, vs.Cols[c].Name); } if (c != 8) { vs.Cols[c].AllowEditing = false; } } for (int r = 0; r < _rs.rows; r++) { vs[r + 1, 0] = r + 1; for (int c = 1; c < _Cols + 1; c++) { vs[r + 1, c] = _rs.record(r, c - 1); } } vs.AutoSizeCols(); // vs.DoubleClick +=new EventHandler(vs_DoubleClick); // vs.KeyDown +=new KeyEventHandler(vs_KeyDown); // this.KeyDown+=new KeyEventHandler(vs_KeyDown); } catch { MessageBox.Show("Load Form Error"); } }
private void cmb_NetMode_SelectionChanged(object sender, SelectionChangedEventArgs e) { App.DUIManager.TTSNet = (ENet)PublicFunction.intParse(cmb_NetMode.SelectedValue); switch (App.DUIManager.TTSNet) { case ENet.Cloud: App.DUIManager.TTSNet = ENet.Cloud; cmb_GeneralSpeaker.SelectedValue = PublicFunction.intParse(LastGeneralSpeaker); //if (ChoiceList != null && ChoiceList.Count > 0) //{ // foreach (var s in ChoiceList) // { // RadioButton rbt = this.FindName(s) as RadioButton; // rbt.IsChecked = true; // } //} //ChoiceList.Clear(); if (ChoiceList != null && ChoiceList.Count > 0) { RadioButton rbt = this.FindName(ChoiceList[PublicFunction.intParse(cmb_GeneralSpeaker.SelectedValue)]) as RadioButton; rbt.IsChecked = true; } manager.OutResult.IsEnabled = true; break; case ENet.Native: App.DUIManager.TTSNet = ENet.Native; LastGeneralSpeaker = (EGeneralSpeaker)cmb_GeneralSpeaker.SelectedValue; foreach (var c in ((tab_SpeakerStyle.SelectedItem as TabItem).Content as WrapPanel).Children) { if (c is RadioButton) { RadioButton rbt = c as RadioButton; if (rbt.IsChecked == true) { ChoiceList[PublicFunction.intParse(cmb_GeneralSpeaker.SelectedValue)] = rbt.Name; //ChoiceList.Add(rbt.Name); break; } } } cmb_GeneralSpeaker.SelectedValue = 0; manager.OutResult.IsEnabled = false; //InitNetChangedUI(false); rbt_Women1.IsChecked = true; break; } }
private void Init_vs1() { nav1.cmd_copy.Visible = false; nav1.cmd_save.Visible = false; nav1.cmd_add.Visible = false; nav1.cmd_delete.Visible = false; nav1.cmd_report.Visible = false; nav1.cmd_search.Visible = false; PublicFunction.InitNav(this, vs1, nav1); vs1.AllowEditing = false; vs1.AfterRowColChange += new RangeEventHandler(vs1_AfterRowColChange); Init_CB1(); nav1.TBarClick += new ToolBarButtonClickEventHandler(nav1_TBarClick); nav1.ToolBar_Auto = false; }
private void cmd_att_Click(object sender, System.EventArgs e) { DateTime d1 = (DateTime)dt1.Value; DateTime d2 = (DateTime)dt2.Value; string swh = "UPDATE FILC01A_VS SET EMP_ID=E.EMP_ID FROM FILB01A E WHERE FILC01A_VS.CRD_NO=E.CRD_NO AND FILC01A_VS.EMP_ID=''" + " AND FILC01A_VS.CRD_DT between '" + d1.ToString("yyyy/MM/dd") + "' and '" + d2.ToString("yyyy/MM/dd") + "'"; PublicFunction.SQL_Execute(swh, PublicFunction.C_con); //Transfer(); Thread th = new Thread(new ThreadStart(Transfer)); th.Start(); timer1.Enabled = true; timer1.Start(); }
public override void Shoot(String name, Vector3 position, Vector3 muzzleOrientation) { if (IntervalTime > 0 && Interval <= 0) { Interval = Cooldown; //以下是花式创建子弹区域,一个Create创建一个子弹 CreateBullet.TotalScene.CreateClassical(name, this, position, PublicFunction.RotationMatrix(muzzleOrientation, Random.Range(-5, 5)), BulletType.Pipe); _random = _random + 4; if (_random > 7.5) { _random = _random - 15; } PlayerAudioCollection.GunCollection.Play("PreArrowShoot"); } }
private void frmTaLeave_Load(object sender, System.EventArgs e) { nav.cmd_copy.Visible = false; nav.cmd_report.Visible = false; nav.cmd_search.Visible = false; nav.cmd_delete.Visible = false; PublicFunction.InitNav(this, vs, nav); nav.Msg_ExitSave = true; nav.Show_VS(" 1=1 ORDER BY SEQ_NO"); nav.ToolBar_Auto = false; Basic.Function.PublicFunction.L_Init_Label(this); nav.TBarClick += new ToolBarButtonClickEventHandler(nav_TBarClick); vs.BeforeEdit += new C1.Win.C1FlexGrid.RowColEventHandler(vs_BeforeEdit); }
private void Init_vs() { nav.cmd_search.Visible = false; nav.cmd_copy.Visible = false; nav.cmd_delete.Visible = false; nav.cmd_add.Visible = false; PublicFunction.InitNav(this, vs, nav); vs.Cols["ATT_TM"].Format = "#0:00"; vs.Cols["WOK_TM"].Format = "#0:00"; nav.ToolBar_Auto = false; nav.TBarClick += new ToolBarButtonClickEventHandler(nav_TBarClick); vs.AfterEdit += new C1.Win.C1FlexGrid.RowColEventHandler(vs_AfterEdit); }
private void frmTaCardReader_Load(object sender, System.EventArgs e) { PublicFunction.InitNav(this, vs, nav); nav.cmd_copy.Visible = false; nav.cmd_report.Visible = false; nav.cmd_search.Visible = false; Basic.Function.PublicFunction.L_Init_Label(this); string sql; //Department sql = "Select TYP_ID,TYP_NM from GP_SYS_READER_TYPE"; PublicFunction.InitCB(cb1, sql); PublicFunction.InitCB(cb2, sql); show_txt(); }
private void cmd_OK_Click(object sender, System.EventArgs e) { if (txt3.Text != "") { stop = false; CL(); Thread th = new Thread(new ThreadStart(BK)); th.Priority = ThreadPriority.Highest; th.Start(); } else { MessageBox.Show(PublicFunction.L_GetLabel(this.Name, 12)); } }
private void Init_vs() { nav.cmd_copy.Visible = false; nav.cmd_exit.Visible = false; PublicFunction.InitNav(this, vs, nav); vs.EnabledChanged += new EventHandler(vs_EnabledChanged); vs.BeforeEdit += new RowColEventHandler(vs_BeforeEdit); nav.TBarClick += new ToolBarButtonClickEventHandler(nav_TBarClick); nav.ToolBar_Auto = false; vs.AfterEdit += new RowColEventHandler(vs_AfterEdit); vs.Cols["WRK_OT"].Format = "##:#0"; vs.Cols["CON_HR"].Format = "##:#0"; //TrungLv(22/06/2018) thêm vào theo yêu c?u c?a khách hàng,qu?n lý thêm lo?i thai s?n. vs.Cols["MAT_ID"].DataMap = PublicFunction.InitCBForVS("SELECT MAT_ID, MAT_NM FROM FILA20A"); }
public int MyDatabaseMethod(string strLoginID,string strUserName,string strUserPwd,string strUserSex,string strBirthday,string strDeptID,string strJobID,string strTelephone,string strCertType,string strCertNum,string strLoginIP,int intUserType,int intUserState,int intJudgeUser,int intJudgeTestType,int intRoleMenu,byte[] imgbin) { string strConn=""; string strSql=""; PublicFunction ObjFun=new PublicFunction(); strConn=ConfigurationSettings.AppSettings["strConn"]; SqlConnection ObjConn = new SqlConnection(strConn); if (imgbin.Length>0) { strSql="Update UserInfo set LoginID=@TmpLoginID,UserName=@TmpUserName,UserPwd=@TmpUserPwd,UserSex=@TmpUserSex,Birthday=@TmpBirthday,DeptID=@TmpDeptID,JobID=@TmpJobID,Telephone=@TmpTelephone,CertType=@TmpCertType,CertNum=@TmpCertNum,LoginIP=@TmpLoginIP,UserType=@TmpUserType,UserState=@TmpUserState,JudgeUser=@TmpJudgeUser,JudgeTestType=@TmpJudgeTestType,RoleMenu=@TmpRoleMenu,UserPhoto=@TmpUserPhoto where UserID="+intUserID+""; } else { strSql="Update UserInfo set LoginID=@TmpLoginID,UserName=@TmpUserName,UserPwd=@TmpUserPwd,UserSex=@TmpUserSex,Birthday=@TmpBirthday,DeptID=@TmpDeptID,JobID=@TmpJobID,Telephone=@TmpTelephone,CertType=@TmpCertType,CertNum=@TmpCertNum,LoginIP=@TmpLoginIP,UserType=@TmpUserType,UserState=@TmpUserState,JudgeUser=@TmpJudgeUser,JudgeTestType=@TmpJudgeTestType,RoleMenu=@TmpRoleMenu where UserID="+intUserID+""; } SqlCommand ObjCmd=new SqlCommand(strSql,ObjConn); //�ʺ� SqlParameter ParamLoginID=new SqlParameter("@TmpLoginID",SqlDbType.VarChar,20); ParamLoginID.Value = strLoginID; ObjCmd.Parameters.Add(ParamLoginID); //���� SqlParameter ParamUserName=new SqlParameter("@TmpUserName",SqlDbType.VarChar,20); ParamUserName.Value = strUserName; ObjCmd.Parameters.Add(ParamUserName); //���� SqlParameter ParamUserPwd=new SqlParameter("@TmpUserPwd",SqlDbType.VarChar,20); ParamUserPwd.Value = strUserPwd; ObjCmd.Parameters.Add(ParamUserPwd); //�Ա� SqlParameter ParamUserSex=new SqlParameter("@TmpUserSex",SqlDbType.VarChar,2); ParamUserSex.Value = strUserSex; ObjCmd.Parameters.Add(ParamUserSex); //�������� if (strBirthday!="") { SqlParameter ParamBirthday=new SqlParameter("@TmpBirthday",SqlDbType.DateTime); ParamBirthday.Value = Convert.ToDateTime(strBirthday); ObjCmd.Parameters.Add(ParamBirthday); } else { SqlParameter ParamBirthday=new SqlParameter("@TmpBirthday",SqlDbType.DateTime); ParamBirthday.Value = System.DBNull.Value; ObjCmd.Parameters.Add(ParamBirthday); } //������� SqlParameter ParamDeptID=new SqlParameter("@TmpDeptID",SqlDbType.Int); ParamDeptID.Value = Convert.ToInt32(strDeptID); ObjCmd.Parameters.Add(ParamDeptID); //ְ�� SqlParameter ParamJobID=new SqlParameter("@TmpJobID",SqlDbType.Int); ParamJobID.Value = Convert.ToInt32(strJobID); ObjCmd.Parameters.Add(ParamJobID); //�绰 SqlParameter ParamTelephone=new SqlParameter("@TmpTelephone",SqlDbType.VarChar,20); ParamTelephone.Value = strTelephone; ObjCmd.Parameters.Add(ParamTelephone); //֤������ SqlParameter ParamCertType=new SqlParameter("@TmpCertType",SqlDbType.VarChar,20); ParamCertType.Value = strCertType; ObjCmd.Parameters.Add(ParamCertType); //֤������ SqlParameter ParamCertNum=new SqlParameter("@TmpCertNum",SqlDbType.VarChar,20); ParamCertNum.Value = strCertNum; ObjCmd.Parameters.Add(ParamCertNum); //��¼IP SqlParameter ParamLoginIP=new SqlParameter("@TmpLoginIP",SqlDbType.VarChar,20); ParamLoginIP.Value = strLoginIP; ObjCmd.Parameters.Add(ParamLoginIP); //���� SqlParameter ParamUserType=new SqlParameter("@TmpUserType",SqlDbType.Int); ParamUserType.Value = Convert.ToInt32(intUserType); ObjCmd.Parameters.Add(ParamUserType); //״̬ SqlParameter ParamUserState=new SqlParameter("@TmpUserState",SqlDbType.Int); ParamUserState.Value = Convert.ToInt32(intUserState); ObjCmd.Parameters.Add(ParamUserState); //�����ʺ� SqlParameter ParamJudgeUser=new SqlParameter("@TmpJudgeUser",SqlDbType.Int); ParamJudgeUser.Value = Convert.ToInt32(intJudgeUser); ObjCmd.Parameters.Add(ParamJudgeUser); //�������� SqlParameter ParamJudgeTestType=new SqlParameter("@TmpJudgeTestType",SqlDbType.Int); ParamJudgeTestType.Value = Convert.ToInt32(intJudgeTestType); ObjCmd.Parameters.Add(ParamJudgeTestType); //��ɫ�˵� SqlParameter ParamRoleMenu=new SqlParameter("@TmpRoleMenu",SqlDbType.Int); ParamRoleMenu.Value = Convert.ToInt32(intRoleMenu); ObjCmd.Parameters.Add(ParamRoleMenu); if (imgbin.Length>0) { SqlParameter ParamUserPhoto=new SqlParameter("@TmpUserPhoto",SqlDbType.Image); ParamUserPhoto.Value = imgbin; ObjCmd.Parameters.Add(ParamUserPhoto); } else { //SqlParameter ParamUserPhoto=new SqlParameter("@TmpUserPhoto",SqlDbType.Image); //ParamUserPhoto.Value = System.DBNull.Value; //ObjCmd.Parameters.Add(ParamUserPhoto); } ObjConn.Open(); int numRowsAffected=ObjCmd.ExecuteNonQuery(); ObjConn.Close(); ObjConn.Dispose(); return numRowsAffected; }