Exemple #1
0
        public static int UpdateApprovalToolOrder(string MainTableName, string OrderIDs, int ApprovalStatus, string Description)
        {
            string sSqlText = "begin";

            sSqlText += " Insert Into ApprovalLog_Info (MainTableName, MainID, ApprovalStatus, ApprovalUserID, ApprovalTime, Description) "
                        + " (Select '" + MainTableName + "', ID, " + ApprovalStatus.ToString() + "," + SysGlobal.GetCurrentUserID().ToString()
                        + ", GetDate(), '" + Description + "' From ToolOrder_Info Where Status=0 And ID In (" + OrderIDs + ")); ";

            sSqlText += " Update ToolOrder_Info Set ApprovalStatus=" + ApprovalStatus.ToString()
                        + ", ApprovalUserID=" + SysGlobal.GetCurrentUserID().ToString() + ", ApprovalTime=GetDate() "
                        + " Where Status=0  And ID In (" + OrderIDs + ");";

            if (ApprovalStatus == DepotTool_ApprovalIsOK)
            {
                sSqlText += "Update PurchaseCredit_Info Set UsedTotalCredit=UsedTotalCredit+b.TotalAmount"
                            + ",UsedCredit1=IsNull(UsedCredit1,0)+(Case Month(b.OrderDate) when 1 then b.TotalAmount else 0 end)"
                            + ",UsedCredit2=IsNull(UsedCredit2,0)+(Case Month(b.OrderDate) when 2 then b.TotalAmount else 0 end)"
                            + ",UsedCredit3=IsNull(UsedCredit3,0)+(Case Month(b.OrderDate) when 3 then b.TotalAmount else 0 end)"
                            + ",UsedCredit4=IsNull(UsedCredit4,0)+(Case Month(b.OrderDate) when 4 then b.TotalAmount else 0 end)"
                            + ",UsedCredit5=IsNull(UsedCredit5,0)+(Case Month(b.OrderDate) when 5 then b.TotalAmount else 0 end)"
                            + ",UsedCredit6=IsNull(UsedCredit6,0)+(Case Month(b.OrderDate) when 6 then b.TotalAmount else 0 end)"
                            + ",UsedCredit7=IsNull(UsedCredit7,0)+(Case Month(b.OrderDate) when 7 then b.TotalAmount else 0 end)"
                            + ",UsedCredit8=IsNull(UsedCredit8,0)+(Case Month(b.OrderDate) when 8 then b.TotalAmount else 0 end)"
                            + ",UsedCredit9=IsNull(UsedCredit9,0)+(Case Month(b.OrderDate) when 9 then b.TotalAmount else 0 end)"
                            + ",UsedCredit10=IsNull(UsedCredit10,0)+(Case Month(b.OrderDate) when 10 then b.TotalAmount else 0 end)"
                            + ",UsedCredit11=IsNull(UsedCredit11,0)+(Case Month(b.OrderDate) when 11 then b.TotalAmount else 0 end)"
                            + ",UsedCredit12=IsNull(UsedCredit12,0)+(Case Month(b.OrderDate) when 12 then b.TotalAmount else 0 end)"
                            + " From ToolOrder_Info b Where b.Status=0 And OrderType=0 And b.ID In (" + OrderIDs + ")"
                            + " And PurchaseCredit_Info.OrganID=b.OrganID And PurchaseCredit_Info.PurchaseYear=Year(b.OrderDate);";
            }

            sSqlText += " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #2
0
        //更新用户密码
        public static Boolean CheckUserNoExists(int _ID, string OpCode)
        {
            string sSqlText = "Select 1 From SysUser_Info Where OpCode='" + OpCode + "' "//And IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " And ID<>" + _ID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #3
0
        public static Boolean CheckToolISNoExists(int ToolISID, string ToolISNo)
        {
            string sSqlText = "Select 1 From ToolIS_Info Where "
                              + " ToolISNo='" + ToolISNo + "' And ID<>" + ToolISID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #4
0
        //更新用户密码
        public static Boolean CheckUserPassword(int UserID, string Password)
        {
            string sSqlText = "Select 1 From SysUser_Info Where "//IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " Password='******' And ID=" + UserID;

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #5
0
        public static Boolean CheckToolOutNoExists(int ToolOutID, string ToolOutNo)
        {
            string sSqlText = "Select 1 From ToolOut_Info Where ToolOutType=" + ToolOutType_ToolOutValue.ToString()
                              + " And ToolOutNo='" + ToolOutNo + "' And ID<>" + ToolOutID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #6
0
        //---新增、修改订单
        public static int UpNewOrder(int _ID, string[] FieldValues, string DetailsSQL)
        {
            string Sql = "";

            if (_ID > 0)
            {
                Sql = Sql + " UPDATE InterPhoneOrder_Info SET OrderNo='" + FieldValues.GetValue(1)
                      + "',Description='" + FieldValues.GetValue(3) + "'"
                      + ",Isfinish=" + FieldValues.GetValue(4);
                Sql = Sql + " WHERE ID=" + _ID + "" + ";";

                Sql += " ;";
            }
            else
            {
                Sql = Sql + " Insert Into InterPhoneOrder_Info (TableRecGuid"
                      + ", OrderNo"
                      + ", OrderDate"
                      + ", OrganID"
                      + ", OrderUserID"
                      + ", Description"
                      + ", Isfinish)"
                      + " Values('" + FieldValues.GetValue(0) + "'"
                      + ",'" + FieldValues.GetValue(1) + "'"
                      + ",GetDate()"
                      + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                      + ",'" + SysGlobal.GetCurrentUserID().ToString() + "'"
                      + ",'" + FieldValues.GetValue(3) + "'"

                      + "," + FieldValues.GetValue(4) + ")";
                Sql = Sql + " ;";
            }
            Sql = Sql + DetailsSQL;
            return(DataCommon.QueryData(Sql));
        }
Exemple #7
0
        //判断机构编号是否重复
        public static Boolean CheckOrganNoExists(int OrganID, string OrganNo)
        {
            string sSqlText = "Select 1 From SysOrgan_Info Where OrganNo='" + OrganNo //+ "' And IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + "' And ID<>" + OrganID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #8
0
        //判断预案编号已被使用
        public static bool CheckRoleIsUse(int RoleID)
        {
            string sSqlText = "Select top 1 1 From User_Info Where Status=0 "//And IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " And ','+UserRoles+',' Like '%," + RoleID.ToString() + ",%'";

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #9
0
        public static Boolean CheckBackTestNoExists(int BackTestID, string BackTestNo)
        {
            string sSqlText = "Select 1 From BackTest_Info "
                              + " Where BackTestNo='" + BackTestNo + "' And ID<>" + BackTestID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #10
0
        public static int AddUploadFiles(int MasterTableType, string MasterTableRecGuid, string sSubCategory, string UploadFileName, string FileName, string FileExt, string FileSize, string sDetailSQL)
        {
            string sUpdateSQL = " Begin";

            sUpdateSQL += " INSERT INTO SysUploadFile_Info (MasterTableType"
                          + ", MasterTableRecGuid"
                          + ",SubCategory"
                          + ",UploadFileName"
                          + ",FileName"
                          + ",FileExt"
                          + ",FileSize"
                          + ",UserID) "
                          + "VALUES(" + MasterTableType.ToString() + ""
                          + ",'" + MasterTableRecGuid + "'"
                          + ",'" + sSubCategory + "'"
                          + ",'" + UploadFileName + "'"
                          + ",'" + FileName + "'"
                          + ",'" + FileExt + "'"
                          + "," + FileSize
                          + "," + SysGlobal.GetCurrentUserID().ToString()
                          + ");";

            sUpdateSQL += sDetailSQL + " End;";
            return(DataCommon.QueryData(sUpdateSQL));
        }
Exemple #11
0
        public static Boolean CheckSendServiceNoExists(int SendServiceID, string SendServiceNo)
        {
            string sSqlText = "Select 1 From SendService_Info "
                              + " Where SendServiceNo='" + SendServiceNo + "' And ID<>" + SendServiceID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #12
0
        public static Boolean CheckInventoryNoExists(int InventoryID, string InventoryNo)
        {
            string sSqlText = "Select 1 From Inventory_Info "
                              + " Where InventoryNo='" + InventoryNo + "' And ID<>" + InventoryID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #13
0
        public static Boolean CheckBorrowNoExists(int ConsumeID, string ConsumeNo)
        {
            string sSqlText = "Select 1 From Consume_Info Where ConsumeType=" + ConsumeType_BorrowValue.ToString()
                              + " And ConsumeNo='" + ConsumeNo + "' And ID<>" + ConsumeID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
        public static Boolean CheckConsumeNoExists(int ConsumeID, string ConsumeNo)
        {
            string sSqlText = "Select 1 From InterPhoneInspection_Info Where ConsumeType=" + ConsumeType_ConsumeValue.ToString()
                              + " And ConsumeNo='" + ConsumeNo + "' And ID<>" + ConsumeID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #15
0
        public static Boolean CheckUserSalaryNoExists(int UserSalaryID, string UserSalaryNo)
        {
            string sSqlText = "Select 1 From UserSalary_Info Where UserSalaryType=" + UserSalaryType_UserSalaryValue.ToString()
                              + " And UserSalaryNo='" + UserSalaryNo + "' And ID<>" + UserSalaryID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #16
0
        //获取角色是否重复
        public static bool CheckRoleNameExists(int ID, string RoleName)
        {
            string sSqlText = "select 1 from SysRole_Info where "//IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " RoleName ='" + RoleName.ToString() + "' and ID<>" + ID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #17
0
        //更新添加工具档案信息
        public static int UpdateSingleSendOut(int _ID, string[] FieldValues, string DetailsSQL)
        {
            string sSqlText = "begin";

            sSqlText += " Update ToolStock_Info Set ToolStock_Info.Quantity=ToolStock_Info.Quantity + b.Quantity "
                        + ", ToolStock_Info.SendOutQuantity=ToolStock_Info.SendOutQuantity - b.Quantity"
                        + " From (Select ToolID, Sum(Quantity) As Quantity From SendOutDetails_Info a, SendOut_Info b where a.SendOutID=b.Id  "
                        + " And b.TableRecGuid='" + FieldValues.GetValue(0) + "' and b.ApprovalStatus=1 And b.Status=0 Group By ToolID) b "
                        + " Where ToolStock_Info.ToolID=b.ToolID And ToolStock_Info.OrganID=" + SysGlobal.GetCurrentUserOrganID().ToString() + ";";

            if (_ID > 0)
            {
                sSqlText = sSqlText + " UPDATE SendOut_Info SET SendOutNo='" + FieldValues.GetValue(1) + "'"
                           + ",Description='" + FieldValues.GetValue(3) + "'"
                           + ",ApprovalStatus='" + FieldValues.GetValue(4) + "'";
                sSqlText = sSqlText + " WHERE ID=" + _ID + "" + ";";

                sSqlText += " ;";
            }
            else
            {
                sSqlText = sSqlText + " Insert Into SendOut_Info (TableRecGuid"
                           + ", SendOutNo"
                           + ", SendOutDate"
                           + ", SendOutOrganID"
                           + ", AcceptOrganID"
                           + ", SendOutUserID"
                           + ", Description"
                           + ", ApprovalStatus)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + ",GetDate()"
                           + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                           + "," + FieldValues.GetValue(2)
                           + ",'" + SysGlobal.GetCurrentUserID().ToString() + "'"
                           + ",'" + FieldValues.GetValue(3) + "'"
                           + ",'" + FieldValues.GetValue(4) + "')";
                sSqlText += " ;";
            }
            sSqlText = sSqlText + DetailsSQL;

            sSqlText += " Insert Into ToolStock_Info (OrganID, ToolID, Quantity)"
                        + " (Select distinct " + SysClass.SysGlobal.GetCurrentUserOrganID().ToString() + ", ToolID, 0 From SendOutDetails_Info Where Status=0 "
                        + " And SendOutID In (Select ID From SendOut_Info Where Status=0 And IsNull(ApprovalStatus,0)=1 And TableRecGuid='" + FieldValues.GetValue(0) + "')"
                        + " And ToolID not in (Select ToolID From ToolStock_Info Where OrganID=" + SysClass.SysGlobal.GetCurrentUserOrganID().ToString() + "));";

            sSqlText += " Update ToolStock_Info Set ToolStock_Info.Quantity=ToolStock_Info.Quantity - b.Quantity "
                        + ", ToolStock_Info.SendOutQuantity=ToolStock_Info.SendOutQuantity + b.Quantity"
                        + " From (Select ToolID, Sum(Quantity) As Quantity From SendOutDetails_Info a, SendOut_Info b where a.SendOutID=b.Id  "
                        + " And b.TableRecGuid='" + FieldValues.GetValue(0) + "'and b.ApprovalStatus=1 And b.Status=0 Group By ToolID) b "
                        + " Where ToolStock_Info.ToolID=b.ToolID And ToolStock_Info.OrganID=" + SysGlobal.GetCurrentUserOrganID().ToString() + ";";

            sSqlText += " Update ToolStockDetail_Info Set ToolStockDetail_Info.ToolStatus=7 From "
                        + " SendOutDetails_Info b where b.SendOutID In (Select ID From SendOut_Info Where Status=0 And IsNull(ApprovalStatus,0)=1 And TableRecGuid='" + FieldValues.GetValue(0) + "') and ToolStockDetail_Info.ID=b.ToolDetailID"
                        + " And ToolStockDetail_Info.OrganID=" + SysClass.SysGlobal.GetCurrentUserOrganID() + ";";

            sSqlText += " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #18
0
        //判断机构编号已被使用
        public static bool CheckToolsNoticeIsUse(int NoticeID)
        {
            string sSqlText = "Select top 1 1 From User_Info Where Status=0 And NoticeID=" + NoticeID.ToString()
                              + " union all "
                              + " Select top 1 1 From Notice_Info Where Status=0 And PNoticeID=" + NoticeID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #19
0
        //判断机构编号已被使用
        public static bool CheckToolsCategoryIsUse(int CategoryID)
        {
            string sSqlText = "Select top 1 1 From User_Info Where Status=0 And CategoryID=" + CategoryID.ToString()
                              + " union all "
                              + " Select top 1 1 From ToolCategory_Info Where Status=0 And PCategoryID=" + CategoryID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #20
0
        //判断机构编号已被使用
        public static bool CheckOrganIsUse(int OrganID)
        {
            string sSqlText = "Select top 1 1 From User_Info Where Status=0 "//And IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " And OrganID=" + OrganID.ToString()
                              + " union all "
                              + " Select top 1 1 From SysOrgan_Info Where Status=0"// And IsNull(SystemID,0)=" + SysParams.GetPurviewSystemID().ToString()
                              + " And POrganID=" + OrganID.ToString();

            return(SysGlobal.GetExecSqlIsExist(sSqlText));
        }
Exemple #21
0
        //更新添加工具档案信息
        public static int UpdateSingleRepairFee(int _ID, string[] FieldValues)
        {
            string sSqlText = " begin";

            sSqlText += " Update PurchaseCredit_Info Set UsedTotalCredit=UsedTotalCredit-b.RepairAmount"
                        + ",UsedCredit1=IsNull(UsedCredit1,0)+(Case Month(b.RepairDate) when 1 then b.RepairAmount else 0 end)"
                        + ",UsedCredit2=IsNull(UsedCredit2,0)+(Case Month(b.RepairDate) when 2 then b.RepairAmount else 0 end)"
                        + ",UsedCredit3=IsNull(UsedCredit3,0)+(Case Month(b.RepairDate) when 3 then b.RepairAmount else 0 end)"
                        + ",UsedCredit4=IsNull(UsedCredit4,0)+(Case Month(b.RepairDate) when 4 then b.RepairAmount else 0 end)"
                        + ",UsedCredit5=IsNull(UsedCredit5,0)+(Case Month(b.RepairDate) when 5 then b.RepairAmount else 0 end)"
                        + ",UsedCredit6=IsNull(UsedCredit6,0)+(Case Month(b.RepairDate) when 6 then b.RepairAmount else 0 end)"
                        + ",UsedCredit7=IsNull(UsedCredit7,0)+(Case Month(b.RepairDate) when 7 then b.RepairAmount else 0 end)"
                        + ",UsedCredit8=IsNull(UsedCredit8,0)+(Case Month(b.RepairDate) when 8 then b.RepairAmount else 0 end)"
                        + ",UsedCredit9=IsNull(UsedCredit9,0)+(Case Month(b.RepairDate) when 9 then b.RepairAmount else 0 end)"
                        + ",UsedCredit10=IsNull(UsedCredit10,0)+(Case Month(b.RepairDate) when 10 then b.RepairAmount else 0 end)"
                        + ",UsedCredit11=IsNull(UsedCredit11,0)+(Case Month(b.RepairDate) when 11 then b.RepairAmount else 0 end)"
                        + ",UsedCredit12=IsNull(UsedCredit12,0)+(Case Month(b.RepairDate) when 12 then b.RepairAmount else 0 end)"
                        + " From RepairFee_Info b Where b.Status=0 And b.ID = " + _ID.ToString()
                        + " And PurchaseCredit_Info.OrganID=b.OrganID And PurchaseCredit_Info.PurchaseYear=Year(b.RepairDate);";

            if (_ID > 0)
            {
                sSqlText += " UPDATE RepairFee_Info SET OrganID=" + FieldValues.GetValue(0)
                            + ", RepairDate='" + FieldValues.GetValue(1) + "'"
                            + ",RepairAmount=" + FieldValues.GetValue(2)
                            + ",Description='" + FieldValues.GetValue(3) + "'";
                sSqlText += sSqlText + " WHERE ID=" + _ID + "" + ";";
            }
            else
            {
                sSqlText += " Insert Into RepairFee_Info ( OrganID, RepairDate, RepairAmount, CreateUserID, Description) Values("
                            + FieldValues.GetValue(0) + ",'" + FieldValues.GetValue(1) + "',"
                            + FieldValues.GetValue(2) + "," + SysGlobal.GetCurrentUserID().ToString() + ",'"
                            + FieldValues.GetValue(3) + "')" + ";";
            }

            sSqlText += " Update PurchaseCredit_Info Set UsedTotalCredit=UsedTotalCredit+b.RepairAmount"
                        + ",UsedCredit1=IsNull(UsedCredit1,0)+(Case Month(b.RepairDate) when 1 then b.RepairAmount else 0 end)"
                        + ",UsedCredit2=IsNull(UsedCredit2,0)+(Case Month(b.RepairDate) when 2 then b.RepairAmount else 0 end)"
                        + ",UsedCredit3=IsNull(UsedCredit3,0)+(Case Month(b.RepairDate) when 3 then b.RepairAmount else 0 end)"
                        + ",UsedCredit4=IsNull(UsedCredit4,0)+(Case Month(b.RepairDate) when 4 then b.RepairAmount else 0 end)"
                        + ",UsedCredit5=IsNull(UsedCredit5,0)+(Case Month(b.RepairDate) when 5 then b.RepairAmount else 0 end)"
                        + ",UsedCredit6=IsNull(UsedCredit6,0)+(Case Month(b.RepairDate) when 6 then b.RepairAmount else 0 end)"
                        + ",UsedCredit7=IsNull(UsedCredit7,0)+(Case Month(b.RepairDate) when 7 then b.RepairAmount else 0 end)"
                        + ",UsedCredit8=IsNull(UsedCredit8,0)+(Case Month(b.RepairDate) when 8 then b.RepairAmount else 0 end)"
                        + ",UsedCredit9=IsNull(UsedCredit9,0)+(Case Month(b.RepairDate) when 9 then b.RepairAmount else 0 end)"
                        + ",UsedCredit10=IsNull(UsedCredit10,0)+(Case Month(b.RepairDate) when 10 then b.RepairAmount else 0 end)"
                        + ",UsedCredit11=IsNull(UsedCredit11,0)+(Case Month(b.RepairDate) when 11 then b.RepairAmount else 0 end)"
                        + ",UsedCredit12=IsNull(UsedCredit12,0)+(Case Month(b.RepairDate) when 12 then b.RepairAmount else 0 end)"
                        + " From RepairFee_Info b Where b.Status=0 And b.ID = " + _ID.ToString()
                        + " And PurchaseCredit_Info.OrganID=b.OrganID And PurchaseCredit_Info.PurchaseYear=Year(b.RepairDate);";

            sSqlText += " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #22
0
        //系统登录
        public static bool UserLogin(string sOpCode, string sPassword, System.Web.SessionState.HttpSessionState hsSession)
        {
            bool          bSuccess = false;
            SqlDataReader sda      = GetUserLogin(sOpCode, sPassword);

            if (sda.Read())
            {
                UserInfo info = new UserInfo();
                info.UserID = int.Parse(sda["ID"].ToString());
                info.OpGuid = sda["Guid"].ToString();
                info.OpCode = sda["OpCode"].ToString();
                info.OpName = sda["OpName"].ToString();
                //权限移到选择系统界面
                //info.UserRolePurview = GetPurviewByUserID(info.UserID);
                info.Purview   = info.UserRolePurview;
                info.UserRoles = sda["UserRoles"].ToString();
                info.IsAdmin   = sda["IsAdmin"].ToString() == "1";
                if (sda["LastDate"].ToString().Length > 0)
                {
                    info.LastDate = DateTime.Parse(sda["LastDate"].ToString()).ToString("yyyy年MM月dd日 HH:mm:ss");
                }
                //info.PurviewSystemID = 0;
                info.LastIp           = sda["LastIP"].ToString();
                info.LastComputerName = sda["LastComputerName"].ToString();
                if (sda["OrganID"].ToString().Length > 0)
                {
                    info.OrganID = SysClass.SysOrgan.GetWorkShopByOrganID(int.Parse(sda["OrganID"].ToString()));
                }
                else
                {
                    info.OrganID = SysClass.SysOrgan.GetTopOrganID(0);
                }

                CyxPack.UserCommonOperation.UserCommonOperation.StoreUserInfo(info);
                // string IP = HttpContext.Current.Request.UserHostAddress;//获取客户端电脑IP
                string IP = "";
                System.Net.IPAddress[] addressList = Dns.GetHostByName(Dns.GetHostName()).AddressList;
                IP = addressList[0].ToString();
                string ComputerName;
                ComputerName = System.Net.Dns.GetHostName();  //获取本地计算机的主机名

                SysLogs.CreateUserLogin(info.UserID, info.OpCode, info.OpName, "用户登录系统。", IP, ComputerName);

                SysClass.SysGlobal.CurrentUserOrganID = SysGlobal.GetCurrentUserOrganID();

                bSuccess = true;
            }
            sda.Close();
            return(bSuccess);
        }
Exemple #23
0
        //审批保存
        public static int UpdateApprovalToolOrder(string MainTableName, string OrderIDs, int ApprovalStatus, string Description)
        {
            string sSqlText = "begin";

            sSqlText += " Insert Into ApprovalLog_Info (MainTableName, MainID, ApprovalStatus, ApprovalUserID, ApprovalTime, Description) "
                        + " (Select '" + MainTableName + "', ID, " + ApprovalStatus.ToString() + "," + SysGlobal.GetCurrentUserID().ToString()
                        + ", GetDate(), '" + Description + "' From WorksShopInterOrder_Info Where Status=0 And ID In (" + OrderIDs + ")); ";

            sSqlText += " Update WorksShopInterOrder_Info Set Isfinish=" + ApprovalStatus.ToString()
                        + ", ApprovalUserID=" + SysGlobal.GetCurrentUserID().ToString() + ", ApprovalTime=GetDate() "
                        + " Where Status=0  And ID In (" + OrderIDs + ");";
            sSqlText += " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #24
0
        public static int UpdateToolTestInfo(int ToolDetailID, int TestUserID, string TestCode, int TestStatus, string Description)
        {
            string sSqlText = "begin";

            sSqlText += " Insert Into ToolTest_Info (ToolDetailID, TestCode, TestDate, TestStatus, Description, TestUserID, OrganID, CreateUserID) "
                        + " Values(" + ToolDetailID.ToString() + ", '" + TestCode.ToString() + "', GetDate()," + TestStatus.ToString()
                        + ",'" + Description + "' ," + TestUserID.ToString() + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                        + "," + SysGlobal.GetCurrentUserID().ToString()
                        + "); ";

            sSqlText += " Update ToolStockDetail_Info Set TestCode='" + TestCode + "', TestStatus=" + TestStatus.ToString() + ", TestDate=GetDate() Where ID=" + ToolDetailID.ToString() + ";";

            sSqlText += " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #25
0
        public static SqlDataReader GetWhereServiceStockDetailToolLstByReader(int CategoryID, string WhereSQL)
        {
            string sSQL = "Select c.*, a.ID as ToolDetailID, a.ToolCode, a.TestCode, IsNull(b.ServiceQuantity, 0) As StockQuantity, 0 As OldQuantity, b.StorageLocation from ToolStockDetail_Info a "
                          + " left join ToolStock_Info b on b.Status=0 And a.ToolID=b.ToolID And b.OrganID=" + SysGlobal.GetCurrentUserOrganID().ToString()
                          + " left join Tool_Info c on c.Status=0 And a.ToolID=c.ID "
                          + " Where c.ToolType=" + _NomalToolType.ToString()
                          + " And a.OrganID=" + SysGlobal.GetCurrentUserOrganID().ToString() + " And a.Status=0" + WhereSQL;

            if (CategoryID > 0)
            {
                sSQL = sSQL + " And c.CategoryID=" + CategoryID.ToString();
            }
            sSQL = sSQL + " Order By a.SortID";

            return(DataCommon.GetDataByReader(sSQL));
        }
Exemple #26
0
        //更新添加工具档案信息
        public static int UpdateSingleToolOrder(int _ID, string[] FieldValues, string DetailsSQL)
        {
            string sSqlText = "begin";

            if (_ID > 0)
            {
                sSqlText = sSqlText + " UPDATE ToolOrder_Info SET OrderNo='" + FieldValues.GetValue(1)
                           + "',OrderType=" + FieldValues.GetValue(2)
                           + ",Description='" + FieldValues.GetValue(3) + "'"
                           + ",ApprovalStatus='" + FieldValues.GetValue(4) + "'"
                           + ",TotalAmount=" + FieldValues.GetValue(5);
                sSqlText = sSqlText + " WHERE ID=" + _ID + "" + ";";

                sSqlText += " ;";
            }
            else
            {
                //sSqlText += " if not exists(Select OrganID, PurchaseYear From PurchaseCredit_Info Where OrganID=" + SysGlobal.GetCurrentUserOrganID().ToString()
                //    + " And PurchaseYear=year(getdate()))"
                //    + " begin"
                //    + "   Insert Into PurchaseCredit_Info (OrganID, PurchaseYear) Values (" + SysGlobal.GetCurrentUserOrganID().ToString() + ", year(getdate()));"
                //    + " end;";

                sSqlText = sSqlText + " Insert Into ToolOrder_Info (TableRecGuid"
                           + ", OrderNo"
                           + ", OrderDate"
                           + ", OrderType"
                           + ", OrganID"
                           + ", OrderUserID"
                           + ", Description"
                           + ", ApprovalStatus"
                           + ", TotalAmount)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + ",GetDate()"
                           + "," + FieldValues.GetValue(2)
                           + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                           + ",'" + SysGlobal.GetCurrentUserID().ToString() + "'"
                           + ",'" + FieldValues.GetValue(3) + "'"
                           + ",'" + FieldValues.GetValue(4) + "'"
                           + "," + FieldValues.GetValue(5) + ")";
                sSqlText = sSqlText + " ;";
            }
            sSqlText = sSqlText + DetailsSQL
                       + " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #27
0
        //添加修改检验单
        public static int UpUserInspection(int _ID, string[] FieldValues, string Sql)
        {
            string sSqlText = "";

            if (_ID > 0)
            {
                sSqlText = sSqlText + " UPDATE InterPhoneCarry_Info SET ConsumeNo='" + FieldValues.GetValue(1) + "'"
                           + ",ConsumeUserID=" + FieldValues.GetValue(2) + ""
                           + ",Description='" + FieldValues.GetValue(3) + "'"
                           + ",ServiceID='" + FieldValues.GetValue(5) + "'"
                           + ",ApprovalStatus='" + FieldValues.GetValue(4) + "'";
                sSqlText = sSqlText + " WHERE ID=" + _ID + "" + ";";

                sSqlText = sSqlText + Sql + " ;";
            }
            else
            {
                sSqlText = sSqlText + " Insert Into InterPhoneCarry_Info (TableRecGuid"
                           + ", ConsumeNo"
                           + ", ConsumeType"
                           + ", ConsumeDate"
                           + ", OrganID"
                           + ", ConsumeUserID"
                           + ", CreateUserID"
                           + ", ServiceID"
                           + ", Description"
                           + ", ApprovalStatus)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + "," + ConsumeType_ConsumeValue.ToString()
                           + ",GetDate()"
                           + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                           + "," + FieldValues.GetValue(2) + ""
                           + "," + SysGlobal.GetCurrentUserID().ToString() + ""
                           + ",'" + FieldValues.GetValue(5) + "'"
                           + ",'" + FieldValues.GetValue(3) + "'"
                           + "," + FieldValues.GetValue(4) + ")";
                sSqlText = sSqlText + Sql + " ;";
            }

            return(DataCommon.QueryData(sSqlText));
        }
Exemple #28
0
        //更新添加工具档案信息
        public static int UpdateSinglePurchaseOrder(int _ID, string[] FieldValues, string DetailsSQL)
        {
            string sSqlText = "begin";

            if (_ID > 0)
            {
                sSqlText = sSqlText + " UPDATE PurchaseOrder_Info SET OrderNo='" + FieldValues.GetValue(1)
                           + "',SupplierID=" + FieldValues.GetValue(2)
                           + ",Description='" + FieldValues.GetValue(3) + "'"
                           + ",ApprovalStatus='" + FieldValues.GetValue(4) + "'"
                           + ",TotalAmount=" + FieldValues.GetValue(5);
                sSqlText = sSqlText + " WHERE ID=" + _ID + "" + ";";

                sSqlText += " ;";
            }
            else
            {
                sSqlText = sSqlText + " Insert Into PurchaseOrder_Info (TableRecGuid"
                           + ", OrderNo"
                           + ", OrderDate"
                           + ", SupplierID"
                           + ", OrderOrganID"
                           + ", OrderUserID"
                           + ", Description"
                           + ", ApprovalStatus"
                           + ", TotalAmount)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + ",GetDate()"
                           + "," + FieldValues.GetValue(2)
                           + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                           + ",'" + SysGlobal.GetCurrentUserID().ToString() + "'"
                           + ",'" + FieldValues.GetValue(3) + "'"
                           + ",'" + FieldValues.GetValue(4) + "'"
                           + "," + FieldValues.GetValue(5) + ")";
                sSqlText += " ;";
            }
            sSqlText = sSqlText + DetailsSQL
                       + " end;";
            return(DataCommon.QueryData(sSqlText));
        }
Exemple #29
0
        //发货单保存修改
        public static int UpUserShiply(int _ID, string[] FieldValues, string Sql)
        {
            string sSqlText = "";

            if (_ID > 0)
            {
                sSqlText = sSqlText + " UPDATE InterphoneShip_Info SET ShipNo='" + FieldValues.GetValue(1) + "'"
                           + ", Isfinish=" + FieldValues.GetValue(5)
                           + ", Description='" + FieldValues.GetValue(4) + "'";
                sSqlText = sSqlText + " WHERE ID=" + _ID + "" + ";";

                sSqlText = sSqlText + Sql + " ;";
            }
            else
            {
                sSqlText = sSqlText + " Insert Into InterphoneShip_Info (TableRecGuid"
                           + ", ShipNo"
                           + ", Quantity"
                           + ", ActionUserID"
                           + ", Shipdate"
                           + ", ShipOrganID"
                           + ", Isfinish"
                           + ", OrderInfoID"
                           + ", Mode"
                           + ", Description)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + ",'" + FieldValues.GetValue(2) + "'"
                           + "," + SysGlobal.GetCurrentUserID().ToString() + ""
                           + ",GetDate()"
                           + "," + FieldValues.GetValue(3) + ""
                           + "," + FieldValues.GetValue(5) + ""
                           + "," + FieldValues.GetValue(6) + ""
                           + ",'" + FieldValues.GetValue(7) + "'"
                           + ",'" + FieldValues.GetValue(4) + "')";
                sSqlText = sSqlText + Sql + " ;";
            }

            return(DataCommon.QueryData(sSqlText));
        }
Exemple #30
0
        //更新添加工具档案信息
        public static int UpdateSingleInventory(int _InventoryID, string[] FieldValues, string DetailsSQL)
        {
            string sSqlText = "begin";

            if (_InventoryID > 0)
            {
                sSqlText = sSqlText + " UPDATE Inventory_Info SET InventoryNo='" + FieldValues.GetValue(1) + "'"
                           + ",InventoryUserID=" + FieldValues.GetValue(2) + ""
                           + ",Description='" + FieldValues.GetValue(3) + "'"
                           + ",ApprovalStatus='" + FieldValues.GetValue(4) + "'";
                sSqlText = sSqlText + " WHERE ID=" + _InventoryID + "" + ";";

                sSqlText += " ;";
            }
            else
            {
                sSqlText = sSqlText + " Insert Into Inventory_Info (TableRecGuid"
                           + ", InventoryNo"
                           + ", InventoryDate"
                           + ", OrganID"
                           + ", InventoryUserID"
                           + ", CreateUserID"
                           + ", Description"
                           + ", ApprovalStatus)"
                           + " Values('" + FieldValues.GetValue(0) + "'"
                           + ",'" + FieldValues.GetValue(1) + "'"
                           + ",GetDate()"
                           + "," + SysGlobal.GetCurrentUserOrganID().ToString()
                           + "," + FieldValues.GetValue(2) + ""
                           + "," + SysGlobal.GetCurrentUserID().ToString() + ""
                           + ",'" + FieldValues.GetValue(3) + "'"
                           + "," + FieldValues.GetValue(4) + ")";
                sSqlText = sSqlText + " ;";
            }
            sSqlText = sSqlText + DetailsSQL
                       + " end;";
            return(DataCommon.QueryData(sSqlText));
        }