Пример #1
0
        public static bool checkLogin(string userName, string pass, string accName)
        {
            bool        flag = false;
            string      str  = "select * from Users where userName='******' and password='******'";
            SqlDataItem item = new SqlDataItem();

            item.CommandText = str;
            try
            {
                DataTable dt = db.getTable(item, accName);
                if (dt != null && dt.Rows.Count > 0)
                {
                    flag = true;
                }
            }
            catch (Exception ex) { }
            return(flag);
        }
Пример #2
0
        public void Edit()
        {
            StringBuilder sqlstr = new StringBuilder();

            sqlstr.Append("update ProductClass set ");
            sqlstr.Append("ClassName='" + ProductClass.ClassName + "',");
            sqlstr.Append("ParentID='" + ProductClass.ParentID + "' ");
            sqlstr.Append("where SID='" + ProductClass.SID + "'");
            SqlDataItem t1 = new SqlDataItem();

            t1.CommandText = sqlstr.ToString();
            if (db.ExecSQL(t1, Account))
            {
                Code = "0000";
                Msg  = "修改成功";
            }
            else
            {
                Code = "0001";
                Msg  = "修改失败";
            }
        }
Пример #3
0
        public void Save()
        {
            StringBuilder sqlstr = new StringBuilder();

            sqlstr.Append("insert into ProductClass (");
            sqlstr.Append("SID, ClassName, ParentID");
            sqlstr.Append(") values (");
            sqlstr.Append("'" + ProductClass.SID + "',");
            sqlstr.Append("'" + ProductClass.ClassName + "',");
            sqlstr.Append("'" + ProductClass.ParentID + "')");
            SqlDataItem t1 = new SqlDataItem();

            t1.CommandText = sqlstr.ToString();
            if (db.ExecSQL(t1, Account))
            {
                Code = "0000";
                Msg  = "保存成功";
            }
            else
            {
                Code = "0001";
                Msg  = "保存失败";
            }
        }
Пример #4
0
 public void Delete()
 {
     try
     {
         string      str1 = "delete from Products where SID='" + Product.SID + "'";
         SqlDataItem t1   = new SqlDataItem();
         t1.CommandText = str1;
         if (db.ExecSQL(t1, Account))
         {
             Code = "0000";
             Msg  = "删除成功";
         }
         else
         {
             Code = "0001";
             Msg  = "删除失败";
         }
     }
     catch (Exception ex)
     {
         Code = "0002";
         Msg  = ex.ToString();
     }
 }
Пример #5
0
        /// <summary>
        /// 获得子表单隶属的主表单
        /// </summary>
        /// <returns></returns>
        public static DataTable GetMainCtrlsOfChild(string userControlId)
        {
            try
            {
                string tmpStr = "select * from UserControlsView where UserControlId=@UserControlId order by mucCaption";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = tmpStr;
                sqlItem.AppendParameter("@userControlId", userControlId);
                ClientDBAgent agent = new ClientDBAgent();
                return agent.ExecuteDataTable(sqlItem);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #6
0
        /// <summary>
        /// 获得所有子表单
        /// </summary>
        /// <returns></returns>
        public static DataTable GetAllChildUserControls()
        {
            try
            {
                string tmpStr = "select * from UserControls order by ucCaption";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = tmpStr;
                ClientDBAgent agent = new ClientDBAgent();
                return agent.ExecuteDataTable(sqlItem);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #7
0
 /// <summary>
 /// 删除子表单隶属的组关系
 /// </summary>
 /// <param name="userControlId"></param>
 /// <returns></returns>
 public static int DeleteMainCtrlsOfUser(string userControlId)
 {
     if (userControlId.Trim().Length == 0 || userControlId == null)
         throw new Exception("DeleteMainCtrlsOfUser方法错误,userControlId 不能为空!");
     try
     {
         string sqlStr = "delete from UserControlsLink where userControlId=@userControlId";
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = sqlStr;
         sqlItem.AppendParameter("@userControlId", userControlId);
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteNonQuery(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #8
0
        /// <summary>
        /// 设置流程分类
        /// </summary>
        /// <param name="workflowId">流程模板Id</param>
        /// <param name="wfclassid">流程分类Id</param>
        /// <returns></returns>
        public static int SetWorkflowClass(string workflowId,string wfclassid)
        {
            try
            {
                string tmpSql = "update workflow set wfclassId=@wfclassid where WorkFlowId=@workflowId";
                SqlDataItem sqlItem = new SqlDataItem();
                sqlItem.CommandText = tmpSql;
                sqlItem.AppendParameter("@workflowId", workflowId);
                sqlItem.AppendParameter("@wfclassid", wfclassid);
                ClientDBAgent agent = new ClientDBAgent();
                return agent.ExecuteNonQuery(sqlItem);

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Пример #9
0
        public static bool Exists(string workFlowid)
        {
            string tmpSql = "select * from workflow where workflowId=@workFlowid";
            SqlDataItem sqlItem = new SqlDataItem();
            sqlItem.AppendParameter("@workFlowid", workFlowid);
            sqlItem.CommandText = tmpSql;
            ClientDBAgent agent = new ClientDBAgent();
            return agent.RecordExists(sqlItem);

        }
Пример #10
0
 /// <summary>
 /// 获得工作流模板信息
 /// </summary>
 /// <param name="workflowId">流程模板名称</param>
 /// <returns></returns>
 public static DataTable GetWorkflowsByCaption(string workflowCaption)
 {
    
     string tmpStr = "select * from workflow where FlowCaption like @workflowCaption";
     try
     {
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = tmpStr;
         sqlItem.AppendParameter("@workflowCaption", "%" + workflowCaption + "%");
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteDataTable(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #11
0
 public static DataTable GetWorkFlowAllControlsTable(string workflowId)
 {
     try
     {
         string tmpStr = "select  * from worktaskControls where WorkFlowId=@workflowId";
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = tmpStr;
         sqlItem.AppendParameter("@workflowId", workflowId);
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteDataTable(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #12
0
 public static int DeleteWorkFlow(string workflowId)
 {
     if (workflowId.Trim().Length == 0 || workflowId == null)
         throw new Exception("DeleteWorkFlow方法错误,workflowId 不能为空!");
     try
     {
         SqlDataItem sqlItem = new SqlDataItem();
         sqlItem.CommandText = "DeleteWorkflow";
         sqlItem.CommandType = CommandType.StoredProcedure;
         sqlItem.AppendParameter("@WorkflowId", workflowId);
         ClientDBAgent agent = new ClientDBAgent();
         return agent.ExecuteNonQuery(sqlItem);
     }
     catch (Exception ex)
     {
         throw ex;
     }
 }
Пример #13
0
 public void Save()
 {
     try
     {
         StringBuilder str1 = new StringBuilder();
         if (!string.IsNullOrWhiteSpace(Product.ProName))
         {
             str1.Append("insert into Products (");
             str1.Append("SID, ProName, AssistCode, Specs, Model, OnlyUnit, BarCode, FactryName, Remark, Creator, CreatDate, Status,ClassID,PinyinCode,");
             str1.Append("Place, Size, Colour, Spare1, Spare2, Spare3, Spare4, Spare5, DIY1, DIY2, DIY3, DIY4, DIY5, Year, MainUnit,");
             str1.Append("PurchaseUnit, PurchaseRate, SaleUnit, SaleRate, InventoryUnit, InventoryRate, AssistUnit, AssistRate, IsFloat");
             str1.Append(") values (");
             str1.Append("'" + Product.SID + "',");
             str1.Append("'" + Product.ProName + "',");
             str1.Append("'" + Product.AssistCode + "',");
             str1.Append("'" + Product.Specs + "',");
             str1.Append("'" + Product.Model + "',");
             str1.Append("'" + Product.OnlyUnit + "',");
             str1.Append("'" + Product.BarCode + "',");
             str1.Append("'" + Product.FactryName + "',");
             str1.Append("'" + Product.Remark + "',");
             str1.Append("'" + Product.Creator + "',");
             str1.Append("'" + Product.CreatDate + "',");
             str1.Append("'" + Product.Status + "', ");
             str1.Append("'" + Product.ClassID + "', ");
             str1.Append("'" + Product.PinyinCode + "', ");
             str1.Append("'" + Product.Place + "',");
             str1.Append("'" + Product.Size + "',");
             str1.Append("'" + Product.Colour + "',");
             str1.Append("'" + Product.Spare1 + "',");
             str1.Append("'" + Product.Spare2 + "',");
             str1.Append("'" + Product.Spare3 + "',");
             str1.Append("'" + Product.Spare4 + "',");
             str1.Append("'" + Product.Spare5 + "',");
             str1.Append("'" + Product.DIY1 + "',");
             str1.Append("'" + Product.DIY2 + "',");
             str1.Append("'" + Product.DIY3 + "',");
             str1.Append("'" + Product.DIY4 + "',");
             str1.Append("'" + Product.DIY5 + "',");
             str1.Append("'" + Product.Year + "',");
             str1.Append("'" + Product.MainUnit + "',");
             str1.Append("'" + Product.PurchaseUnit + "',");
             str1.Append("'" + Product.PurchaseRate + "',");
             str1.Append("'" + Product.SaleUnit + "',");
             str1.Append("'" + Product.SaleRate + "',");
             str1.Append("'" + Product.InventoryUnit + "',");
             str1.Append("'" + Product.InventoryRate + "',");
             str1.Append("'" + Product.AssistUnit + "',");
             str1.Append("'" + Product.AssistRate + "',");
             str1.Append("'" + Product.IsFloat + "')");
             SqlDataItem t1 = new SqlDataItem();
             t1.CommandText = str1.ToString();
             if (db.ExecSQL(t1, Account))
             {
                 Code = "0000";
                 Msg  = "保存成功";
             }
             else
             {
                 Code = "0001";
                 Msg  = "保存失败";
             }
         }
         else
         {
             Code = "0002";
             Msg  = "未找到商品";
         }
     }
     catch (Exception ex)
     {
         Code = "0003";
         Msg  = ex.ToString();
     }
 }
Пример #14
0
 public void Edit()
 {
     try
     {
         StringBuilder str1 = new StringBuilder();
         if (!string.IsNullOrWhiteSpace(Product.ProName))
         {
             str1.Append("update Products set ");
             str1.Append("ProName='" + Product.ProName + "',");
             str1.Append("AssistCode='" + Product.AssistCode + "',");
             str1.Append("Specs='" + Product.Specs + "',");
             str1.Append("Model='" + Product.Model + "',");
             str1.Append("OnlyUnit='" + Product.OnlyUnit + "',");
             str1.Append("BarCode='" + Product.BarCode + "',");
             str1.Append("FactryName='" + Product.FactryName + "',");
             str1.Append("Remark='" + Product.Remark + "' ");
             str1.Append("Place='" + Product.Place + "',");
             str1.Append("Size='" + Product.Size + "',");
             str1.Append("ClassID='" + Product.ClassID + "',");
             str1.Append("PinyinCode='" + Product.PinyinCode + "',");
             str1.Append("Colour='" + Product.Colour + "',");
             str1.Append("Spare1='" + Product.Spare1 + "',");
             str1.Append("Spare2='" + Product.Spare2 + "',");
             str1.Append("Spare3='" + Product.Spare3 + "',");
             str1.Append("Spare4='" + Product.Spare4 + "',");
             str1.Append("Spare5='" + Product.Spare5 + "',");
             str1.Append("DIY1='" + Product.DIY1 + "',");
             str1.Append("DIY2='" + Product.DIY2 + "',");
             str1.Append("DIY3='" + Product.DIY3 + "',");
             str1.Append("DIY4='" + Product.DIY4 + "',");
             str1.Append("DIY5='" + Product.DIY5 + "',");
             str1.Append("Year'" + Product.Year + "',");
             str1.Append("MainUnit'" + Product.MainUnit + "',");
             str1.Append("PurchaseUnit'" + Product.PurchaseUnit + "',");
             str1.Append("PurchaseRate'" + Product.PurchaseRate + "',");
             str1.Append("SaleUnit'" + Product.SaleUnit + "',");
             str1.Append("SaleRate'" + Product.SaleRate + "',");
             str1.Append("InventoryUnit'" + Product.InventoryUnit + "',");
             str1.Append("InventoryRate'" + Product.InventoryRate + "',");
             str1.Append("AssistUnit'" + Product.AssistUnit + "',");
             str1.Append("AssistRate'" + Product.AssistRate + "',");
             str1.Append("IsFloat'" + Product.IsFloat + "' ");
             str1.Append("where SID='" + Product.SID + "'");
             SqlDataItem t1 = new SqlDataItem();
             t1.CommandText = str1.ToString();
             if (db.ExecSQL(t1, Account))
             {
                 Code = "0000";
                 Msg  = "修改成功";
             }
             else
             {
                 Code = "0001";
                 Msg  = "修改失败";
             }
         }
         else
         {
             Code = "0002";
             Msg  = "未找到商品";
         }
     }
     catch (Exception ex)
     {
         Code = "0003";
         Msg  = ex.ToString();
     }
 }