/* * 方法 */ #region [ 方法: 添加时段信息 ] public int TimerInterval_Insert(string strIntervalName, string strNameShort, string strStartWorkTime, string strEndWorkTime, int intSWDateType, int intEWDateType, int intSWFrontTime, int intSWAfterTime, int intEWFrontTime, int intEWAfterTime, int intClassID, int intDataAttendanceType, out string strErr) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@IntervalName", SqlDbType.VarChar, 50), new SqlParameter("@NameShort", SqlDbType.VarChar, 8), new SqlParameter("@StartWorkTime", SqlDbType.VarChar, 20), new SqlParameter("@EndWorkTime", SqlDbType.VarChar, 20), new SqlParameter("@SWDateType", SqlDbType.Int, 4), new SqlParameter("@EWDateType", SqlDbType.Int, 4), new SqlParameter("@SWFrontTime", SqlDbType.Int, 4), new SqlParameter("@SWAfterTime", SqlDbType.Int, 4), new SqlParameter("@EWFrontTime", SqlDbType.Int, 4), new SqlParameter("@EWAfterTime", SqlDbType.Int, 4), new SqlParameter("@ClassID", SqlDbType.Int, 4), new SqlParameter("@DataAttendanceType", SqlDbType.Int, 4), new SqlParameter("@ID", SqlDbType.Int) }; parameters[0].Value = strIntervalName; parameters[1].Value = strNameShort; parameters[2].Value = strStartWorkTime; parameters[3].Value = strEndWorkTime; parameters[4].Value = intSWDateType; parameters[5].Value = intEWDateType; parameters[6].Value = intSWFrontTime; parameters[7].Value = intSWAfterTime; parameters[8].Value = intEWFrontTime; parameters[9].Value = intEWAfterTime; parameters[10].Value = intClassID; parameters[11].Value = intDataAttendanceType; parameters[12].Value = strIntervalName.GetHashCode(); return(DB.ExecuteSql("Shine_TimerInterval_Add", parameters, out strErr)); }
/// <summary> /// 添加异地交接班信息 /// </summary> /// <param name="stationAddress">传输分站号</param> /// <param name="stationHeadAddress">读卡分站号</param> /// <param name="stationHeadPlace">读卡分站安装位置</param> /// <param name="beginTime">开始时间</param> /// <param name="endTime">结束时间</param> /// <param name="empid1">人员编号1</param> /// <param name="empid2">人员编号2</param> /// <param name="empName1">人员姓名1</param> /// <param name="empName2">人员姓名2</param> /// <returns>执行的行数</returns> public int AddAssociate(int stationAddress, int stationHeadAddress, string stationHeadPlace, DateTime beginTime, DateTime endTime, int empid1, int empid2, string empName1, string empName2) { SqlParameter[] para = { new SqlParameter("@stationAddress", SqlDbType.Int), new SqlParameter("@stationHeadAddress", SqlDbType.Int), new SqlParameter("@stationHeadPlace", SqlDbType.VarChar, 20), new SqlParameter("@beginTime", SqlDbType.DateTime), new SqlParameter("@endTime", SqlDbType.DateTime), new SqlParameter("@empid1", SqlDbType.Int), new SqlParameter("@empid2", SqlDbType.Int), new SqlParameter("@empName1", SqlDbType.VarChar, 20), new SqlParameter("@empName2", SqlDbType.VarChar, 20), new SqlParameter("@ID", SqlDbType.Int) }; para[0].Value = stationAddress; para[1].Value = stationHeadAddress; para[2].Value = stationHeadPlace; para[3].Value = beginTime; para[4].Value = endTime; para[5].Value = empid1; para[6].Value = empid2; para[7].Value = empName1; para[8].Value = empName2; para[9].Value = (stationAddress.ToString() + "," + stationHeadAddress.ToString() + "," + beginTime.ToString() + "," + endTime.ToString() + "," + empid1.ToString() + "," + empid2.ToString()).GetHashCode(); return(dba.ExecuteSql("Associate_Insert", para)); }
/// <summary> /// 根据探头名称修改探头位置 /// </summary> /// <param name="stationheadx">探头位置坐标X</param> /// <param name="stationheady">探头位置坐标Y</param> /// <param name="stationheadplace">探头名称</param> /// <returns>是否成功</returns> public string UpdateStationInfo(string stationheadx, string stationheady, string stationheadplace) { string updatestring = string.Format(" update Station_Head_Info set stationheadx={0},stationheady={1} where stationheadplace='{2}' ", stationheadx, stationheady, stationheadplace); dba.ExecuteSql(updatestring); return(updatestring); }
public void ClearRtInfo() { try { string sqlstr = "delete from rt_instationheadinfo where codesenderaddress not in(select codesenderaddress from rt_inoutmine) and userid is not null" + " and stationheadid not in(select stationheadid from station_head_info where stationheadtypeid=8)"; dba.ExecuteSql(sqlstr); } catch { } }
public void InsertBackMap(string filename, byte[] buffer) { string selectstring = "Shine_AddGraphicsBackGroudFile"; SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@filename", SqlDbType.VarChar, 50), new SqlParameter("@fileimage", SqlDbType.Image) }; parameters[0].Value = filename; parameters[1].Value = buffer; dba.ExecuteSql(selectstring, parameters); }
public int SaveTerType(string TypeName, byte IsAlarm, string Remark) { strSQL = string.Format( "if(not exists(select 1 from Territorial_Type where TypeName='" + TypeName + "')) " + " begin " + " insert into Territorial_Type(TerritorialTypeID,TypeName,IsAlarm,Remark) values({3},'{0}',{1},'{2}')" + " end ", TypeName, IsAlarm, Remark, TypeName.GetHashCode()); return(dba.ExecuteSql(strSQL)); }
public bool InsertSWTer(string terid, string wtid) { string sqlstr = string.Format("insert into SWorkTypeTerrialSet(TerriAlarmID,TerrialID,WorkTypeID,IsAlarm,Remark) values({0},{0},{1},1,'')", terid, wtid); if (dba.ExecuteSql(sqlstr) > 0) { return(true); } else { return(false); } }
public int deleteip(int id) { string procName = "proc_IpStationConfig_delete_txj"; SqlParameter[] sqlParmeters = { new SqlParameter("ID", SqlDbType.Int) }; sqlParmeters[0].Value = id; return(dba.ExecuteSql(procName, sqlParmeters)); }
public int TaskTime_Insert(int intHour, int intMinute, string strRemark, out string strErr) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@HourNumber", SqlDbType.BigInt, 8), new SqlParameter("@MinuteNumber", SqlDbType.BigInt, 8), new SqlParameter("@Remark", SqlDbType.VarChar, 100) }; parameters[0].Value = intHour; parameters[1].Value = intMinute; parameters[2].Value = strRemark; return(DB.ExecuteSql("Shine_TastTime_Add", parameters, out strErr)); }
public int DeleteEmp(string strEmpID, string strUserID) { int i; string sqlStr1 = "delete from Emp_Info where " + strEmpID; i = dba.ExecuteSql(sqlStr1); string sqlStr2 = "select * from CodeSender_Set where ( " + strUserID + " ) and CsTypeID=0"; if (GetBool(sqlStr2)) { string sqlStr3 = "delete from CodeSender_Set where ( " + strUserID + " ) and CsTypeID=0"; i = dba.ExecuteSql(sqlStr3); } return(i); }
public void AddFile(string filename, byte[] xmlbyte, byte[] imgbyte) { string sqlstr = "KJ128N_Graphics_AddConfigFile"; SqlParameter[] Parameters = { new SqlParameter("@filename", SqlDbType.VarChar, 50), new SqlParameter("@configfile", SqlDbType.Image), new SqlParameter("@mapfile", SqlDbType.Image) }; Parameters[0].Value = filename; Parameters[1].Value = xmlbyte; Parameters[2].Value = imgbyte; dba.ExecuteSql(sqlstr, Parameters); }
public bool addMenu(string title, string pname, string name) { SqlParameter[] parameters = { new SqlParameter("pname", SqlDbType.VarChar, 50), new SqlParameter("Title", SqlDbType.VarChar, 50), new SqlParameter("name", SqlDbType.VarChar, 50) }; parameters[0].Value = pname; parameters[1].Value = title; parameters[2].Value = name;; int a = dbacc.ExecuteSql("MenuInsert", parameters); return(a != -1 ? true : false); }
public int InsertEmpInfo(EmpPostModel empPostModel) { SqlParameter[] para = new SqlParameter[] { new SqlParameter("@CodeSenderAddress", SqlDbType.Int), new SqlParameter("@TerritorialID", SqlDbType.Int), new SqlParameter("@WorkTime", SqlDbType.Int), new SqlParameter("@Remark", SqlDbType.NVarChar, 200) }; para[0].Value = empPostModel.CodeSenderAddress; para[1].Value = empPostModel.TerritorialID; para[2].Value = empPostModel.WorkTime; para[3].Value = empPostModel.Remark; return(dbacc.ExecuteSql("zjw_EmpPost_Insert", para)); }
public int InfoClass_Insert(string strClassName, string strShortName, string strRemark, out string strErr) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@ClassName", SqlDbType.VarChar, 20), new SqlParameter("@ShortName", SqlDbType.VarChar, 20), new SqlParameter("@Remark", SqlDbType.VarChar, 200), new SqlParameter("@ID", SqlDbType.Int) }; parameters[0].Value = strClassName; parameters[1].Value = strShortName; parameters[2].Value = strRemark; parameters[3].Value = strClassName.GetHashCode(); return(DB.ExecuteSql("Shine_InfoClass_Add", parameters, out strErr)); }
public bool DelAllPoint() { try { string delstr = "DELETE FROM Points"; if (dba.ExecuteSql(delstr) > 0) { return(true); } else { return(false); } } catch (Exception ex) { throw ex; } }
/// <summary> /// 修改用户组菜单 /// </summary> /// <param name="UserGroupID">用户组id</param> /// <param name="name">菜单项</param> /// <param name="ISuse">是否可用</param> /// <returns>true 执行成功 false 失败</returns> public bool insertUserGroups(int UserGroupID, string name, bool ISuse) { SqlParameter[] para = { new SqlParameter("@name", SqlDbType.VarChar, 50), new SqlParameter("@UserGroupID", SqlDbType.Int), new SqlParameter("@ISuse", SqlDbType.Bit), }; para[0].Value = name; para[1].Value = UserGroupID; para[2].Value = ISuse; return((dbacc.ExecuteSql("insertUserGroupMenu1", para) == -1) ? false : true); }
public bool InsertEquBaseInfo(string equno, string equname, int deptid, string DeptName, int equtype, int equstate, int factoryid, string remark) { string sqlstr = string.Format("if not exists (select * from Equ_BaseInfo where equno='{0}') insert into Equ_BaseInfo(EquID,EquNO,EquName,DeptID,DeptName,EquType,EquState,FactoryID,Remark) values ({0},'{1}','{2}',{3},'{4}',{5},{6},{7},'{8}')", equno.GetHashCode(), equno, equname, deptid, DeptName, equtype, equstate, factoryid, remark); if (dba.ExecuteSql(sqlstr) > 0) { return(true); } else { return(false); } }
public bool UpDatePassWord(string strUserName, string strPassWord) { strSql = " UpDate Admins Set Password ='******' Where Account ='" + strUserName + "'"; if (dbacc.ExecuteSql(strSql) == 1) { return(true); } else { return(false); } }
public int WalkConfig_InsertAndUpDate(int intFirstStationAddress, int intFirstStationHeadAddress, int intLastStationAddress, int intLastStationHeadAddress, int intWalkTime, string strRemark, int intLackWalkTime) { SqlParameter[] para = { new SqlParameter("@FirstStationAddress", SqlDbType.Int), new SqlParameter("@FirstStationHeadAddress", SqlDbType.Int), new SqlParameter("@LastStationAddress", SqlDbType.Int), new SqlParameter("@LastStationHeadAddress", SqlDbType.Int), new SqlParameter("@WalkTime", SqlDbType.Int), new SqlParameter("@Remark", SqlDbType.NVarChar,200), new SqlParameter("@LackWalkTime", SqlDbType.Int), new SqlParameter("@ID", SqlDbType.Int) }; para[0].Value = intFirstStationAddress; para[1].Value = intFirstStationHeadAddress; para[2].Value = intLastStationAddress; para[3].Value = intLastStationHeadAddress; para[4].Value = intWalkTime; para[5].Value = strRemark; para[6].Value = intLackWalkTime; para[7].Value = (intFirstStationAddress.ToString() + "," + intFirstStationHeadAddress.ToString() + ";" + intLastStationAddress.ToString() + "," + intLastStationHeadAddress.ToString()).GetHashCode(); return(dba.ExecuteSql("A_WalkSpeed_InsertAndUpDate", para)); }
public int HolidayType_Insert(string strHolidayCode, string strHolidayName, string strHolidayAcronym, string remark, out string strErr) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@HolidayCode", SqlDbType.VarChar, 20), new SqlParameter("@HolidayName", SqlDbType.VarChar, 20), new SqlParameter("@HolidayAcronym", SqlDbType.VarChar, 10), new SqlParameter("@remark", SqlDbType.VarChar, 200), new SqlParameter("@ID", SqlDbType.Int) }; parameters[0].Value = strHolidayCode; parameters[1].Value = strHolidayName; parameters[2].Value = strHolidayAcronym; //if (remark.Length == 0) //{ // remark = ""; //} parameters[3].Value = remark; parameters[4].Value = strHolidayCode.GetHashCode(); return(DB.ExecuteSql("Shine_HolidayType_Add", parameters, out strErr)); }
public int UpDateAlarmSet(int intAlarmSetType, bool blEnumValue, int intAlarmWaveType, string strAlarmWavePath) { string procName = "KJ128N_AlarmSet_UpDate"; SqlParameter[] sqlParmeters = { new SqlParameter("AlarmSetType", SqlDbType.Int), new SqlParameter("EnumValue", SqlDbType.NVarChar,20), new SqlParameter("AlarmWaveType", SqlDbType.Int), new SqlParameter("AlarmWavePath", SqlDbType.NVarChar, 100) }; sqlParmeters[0].Value = intAlarmSetType; if (blEnumValue) { sqlParmeters[1].Value = 1; } else { sqlParmeters[1].Value = 0; } sqlParmeters[2].Value = intAlarmWaveType; sqlParmeters[3].Value = strAlarmWavePath; return(dbacc.ExecuteSql(procName, sqlParmeters)); }
public int HolidayManage_Insert(int intBlockID, string strEmployeeName, int intDeptID, string strBeginWorkDate, string strHolidayName, int intOperatorID, int ClassID, out string strErr) { SqlParameter[] parameters = new SqlParameter[] { new SqlParameter("@BlockID", SqlDbType.Int, 4), new SqlParameter("@EmployeeName", SqlDbType.VarChar, 20), new SqlParameter("@DeptID", SqlDbType.Int, 4), new SqlParameter("@BeginWorkDate", SqlDbType.VarChar, 20), new SqlParameter("@HolidayName", SqlDbType.VarChar, 20), new SqlParameter("@OperatorID", SqlDbType.Int, 4) //new SqlParameter("@ClassID",SqlDbType.Int,4) }; parameters[0].Value = intBlockID; parameters[1].Value = strEmployeeName; parameters[2].Value = intDeptID; parameters[3].Value = strBeginWorkDate; parameters[4].Value = strHolidayName; parameters[5].Value = intOperatorID; //parameters[6].Value = ClassID; return(DB.ExecuteSql("Shine_HistoryHolidays_Add", parameters, out strErr)); }
public int SavePrint(string str1, string str2, string str3, string str4, string str5, string str6, string str7, string strTime) { SqlParameter[] sqlParmeters = { new SqlParameter("@str1", SqlDbType.VarChar, 20), new SqlParameter("@str2", SqlDbType.VarChar, 20), new SqlParameter("@str3", SqlDbType.VarChar, 20), new SqlParameter("@str4", SqlDbType.VarChar, 20), new SqlParameter("@str5", SqlDbType.VarChar, 20), new SqlParameter("@str6", SqlDbType.VarChar, 20), new SqlParameter("@str7", SqlDbType.VarChar, 20), new SqlParameter("@strTime", SqlDbType.VarChar, 20), }; sqlParmeters[0].Value = str1; sqlParmeters[1].Value = str2; sqlParmeters[2].Value = str3; sqlParmeters[3].Value = str4; sqlParmeters[4].Value = str5; sqlParmeters[5].Value = str6; sqlParmeters[6].Value = str7; sqlParmeters[7].Value = strTime; return(dbacc.ExecuteSql("zjw_SavePrint", sqlParmeters)); }
/// <summary> /// 删除指定的标识卡配置信息 /// </summary> /// <param name="codeaddress"></param> /// <returns></returns> public int DeleteCodeSenderSet(string codeaddress) { string sqlstr = string.Format("delete from CodeSender_Set where codesenderaddress={0} update CodeSender_Info set iscodesenderuser=2 where codesenderaddress={0}", codeaddress); return(dba.ExecuteSql(sqlstr)); }
public int SaveMeasure(string strEmpID, string strMeasure) { strSQL = "Update RT_EmpHelp Set Measure='" + strMeasure + "' where EmpID=" + strEmpID; return(dbacc.ExecuteSql(strSQL)); }
public void DeleteStationHead(int intValue) { string deleteString = string.Format(" delete from Territorial_Set where StationHeadID={0}", intValue); dba.ExecuteSql(deleteString); }
public int updateStation(int sAddress, string place, string tel, int typeId, string typeName, int group) { string sqlString = string.Format("update Station_Info set StationPlace='{0}',StationTel='{1}',StationTypeID={2},StationType='{3}'" + ",EditBaseInfo=2,StationGroup={4} where StationAddress={5}", place, tel, typeId, typeName, group, sAddress); return(dba.ExecuteSql(sqlString)); }
public int InsertBackPicFile(string filename, byte[] filebytes) { int success = 0; string sqlstr = "Proc_DbackPic_AddFile"; SqlParameter[] Parameters = { new SqlParameter("@filename", SqlDbType.VarChar, 50), new SqlParameter("@fileimg", SqlDbType.Image), new SqlParameter("@success", SqlDbType.Int), new SqlParameter("@ID", SqlDbType.Int) }; Parameters[0].Value = filename; Parameters[1].Value = filebytes; Parameters[2].Direction = ParameterDirection.Output; Parameters[2].Value = success; Parameters[3].Value = filename.GetHashCode(); dba.ExecuteSql(sqlstr, Parameters); success = Convert.ToInt32(Parameters[2].Value); return(success); }
//private DeserializeDockContent m_deserializeDockContent; //private bool m_bSaveLayout = true; #endregion #region 保存菜单 private void SetMenuAll(ToolStripItemCollection items) { KJ128NDataBase.DBAcess dba = new KJ128NDataBase.DBAcess(); foreach (ToolStripItem tsi in items) { if (tsi is ToolStripMenuItem) { //ToolStrip TS = tsi.Owner; string str = string.Format("insert into menus1(PMenuID,Title,name) values({2},'{0}','{1}')", ((ToolStripMenuItem)tsi).Text.Substring(0, ((ToolStripMenuItem)tsi).Text.Length - 4), ((ToolStripMenuItem)tsi).Name , ((ToolStripMenuItem)tsi).Owner.Name == "msMainMenu" ? "-1" : dba.ExecuteScalarSql("select id from menus1 where name ='" + ((ToolStripMenuItem)tsi).OwnerItem.Name + "'")); dba.ExecuteSql(str); System.IO.File.AppendAllText("c:/sql.txt", str + "\r\n", Encoding.Default); if (((ToolStripMenuItem)tsi).DropDownItems.Count > 0) { SetMenuAll(((ToolStripMenuItem)tsi).DropDownItems); } } } }
public int SaveEmpCount(string strEmpCount) { strSQL = " UpDate EnumTable Set EnumValue='" + strEmpCount + "' Where FunID=8 and EnumID=1"; return(dba.ExecuteSql(strSQL)); }
/// <summary> /// 存储员工基本信息 /// </summary> /// <param name="empName">员工姓名</param> /// <param name="empNO">员工工号</param> /// <param name="sex">员工性别</param> /// <param name="remark">备注</param> /// <returns>返回影响行数(int)</returns> public int SaveEmployeeBaseInfoData(string empName, string empNO, bool sex, string remark) { string procName = "KJ128N_Emp_Info_Insert"; SqlParameter[] sqlParmeters = { new SqlParameter("EmpName", SqlDbType.NVarChar, 20), new SqlParameter("EmpNO", SqlDbType.NVarChar, 10), new SqlParameter("Sex", SqlDbType.Bit), new SqlParameter("Remark", SqlDbType.NVarChar, 200) }; sqlParmeters[0].Value = empName; sqlParmeters[1].Value = empNO; sqlParmeters[2].Value = sex; sqlParmeters[3].Value = remark; return(dba.ExecuteSql(procName, sqlParmeters)); }