Пример #1
0
 public object[] GetDataByParent(string ParentKey)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_DeployD.DeployMID", "=", "DeployMID", ParentKey));
     qs.OrderBy = " Flow_DeployD.Seq ";
     return GetMaster(qs);
 }
Пример #2
0
 public string GetActivityOwner(string DeployKey, string ProcessName, string ActivityName)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_DeployD.DeployKey", "=", "DeployKey", DeployKey));
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_DeployD.ProcessName", "=", "ProcessName", ProcessName));
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_DeployD.ActivityName", "=", "ActivityName", ActivityName));
     DataTable dt = GetMaster(qs)[1] as DataTable;
     if (dt.Rows.Count > 0)
         return dt.Rows[0]["WhoCanSubmit"].ToString();
     else
         return "";
 }
Пример #3
0
 void WebReport1_StartReport(object sender, EventArgs e)
 {
     RDFNew.Module.Admin.Pur.Pur_PoM obj = new RDFNew.Module.Admin.Pur.Pur_PoM();
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos = GetQueryInfo();
     qs.OrderBy = " Pur_PoM.PoMID Desc ";
     object[] data = obj.GetMaster(qs);
     if (data[0].ToString() == "0") //正常
     {
         DataTable dt = data[1] as DataTable;
         Report FReport = (sender as FastReport.Web.WebReport).Report;
         FReport.RegisterData(dt, "Table");
     }
 }
Пример #4
0
 public object[] GetMaster(string KeyValue)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_ToDoM.ToDoMID", "=", "ToDoMID", KeyValue));
     return GetMaster(qs);
 }
Пример #5
0
 public object[] GetMaster(string KeyValue)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Hr_LeaveType.LeaveTypeID", "=", "LeaveTypeID", KeyValue));
     return GetMaster(qs);
 }
Пример #6
0
 protected virtual void DeleteData()
 {
     if(B_Grid1 != null && B_IDAL !=null)
     {
     string KeyVal = "";
     KeyVal = B_Grid1.DataKeys[this.B_Grid1.SelectedRowIndex][0].ToString();
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo(B_TableKey,"=","DeleteKey", KeyVal));
     try
     {
         object[] data = B_IDAL.GetMaster(qs);
         if (data[0].ToString() == "0") //正常
         {
             DataTable table = data[1] as DataTable;
             if (table.Rows.Count > 0)
             {
                 table.Rows[0].Delete();
                 data = B_IDAL.ApplyMaster(table.GetChanges(DataRowState.Deleted),App_Com.Helper.BuildLog(B_ModuleID, "delete"));
                 if (data[0].ToString() == "0") //正常
                 {
                     AfterDeleteData(table);
                     LoadMater();
                     PageContext.RegisterStartupScript("PageList.grid_SelectRowFocus();");
                 }
                 else
                 {
                     throw data[1] as Exception;
                 }
             }
         }
         else
         {
             throw data[1] as Exception;
         }
     }
     catch (Exception ex)
     {
         StringBuilder sb = new StringBuilder();
         while (ex != null)
         {
             sb.Append(ex.Message + "\r\n");
             ex = ex.InnerException;
         }
         Alert.Show("发生如下错误:\r\n" + sb.ToString(), MessageBoxIcon.Error);
     }
     }
 }
Пример #7
0
        protected virtual void LoadMater()
        {
            if (B_Grid1 != null && B_IDAL!=null)
            {
                RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
                qs.PageInfo = new RDFNew.Module.DALEntity.PageInfo(B_Grid1.PageSize, B_Grid1.PageIndex);
                qs.QueryInfos = GetQueryInfo();
                if (B_Grid1.SortColumn != "")
                    qs.OrderBy = B_Grid1.SortColumn + " " + B_Grid1.SortDirection;
                else
                    qs.OrderBy = B_OrderBy;
                object[] data = B_IDAL.GetMaster(qs);

                if (data[0].ToString() == "0") //正常
                {
                    B_Grid1.RecordCount = Convert.ToInt32(data[2]);
                    DataTable table = data[1] as DataTable;
                    BeforeDataBind(table);
                    B_Grid1.DataSource = table;
                    B_Grid1.DataBind();
                }
                else
                {
                    B_Grid1.DataSource = null;
                    Exception ex = data[1] as Exception;
                    StringBuilder sb = new StringBuilder();
                    while (ex != null)
                    {
                        sb.Append(ex.Message + "\r\n");
                        ex = ex.InnerException;
                    }
                    Alert.Show("发生如下错误:\r\n" + sb.ToString(), MessageBoxIcon.Error);
                }
            }
        }
Пример #8
0
 public object[] GetMaster(string KeyValue)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Sys_Menu.MenuID", "=", "MenuID", KeyValue));
     return GetMaster(qs);
 }
Пример #9
0
 void SaveData()
 {
     RDFNew.Module.Admin.Flow.Flow_DeployM dal = new RDFNew.Module.Admin.Flow.Flow_DeployM();
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Flow_DeployM.DeployMID", "=", "DeployMID", B_Keyword));
     DataTable dt = dal.GetMaster(qs)[1] as DataTable;
     if (dt.Rows.Count == 0)
     {
         //新增
         AddData();
     }
     else
     {
         //更新
         UpdateData();
     }
 }
Пример #10
0
 public object[] GetMaster(string KeyValue)
 {
     RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
     qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo("Bas_Employee.EmployeeID", "=", "EmployeeID", KeyValue));
     return GetMaster(qs);
 }
Пример #11
0
        public static object UpdateTable(string tbName, string pkField, DataRow dr,
            SqlTransaction tran, RDFNew.Module.DALEntity.Sys_Log la)
        {
            string FID = dr[pkField].ToString();

            if (la != null)
            {
                la.Table = tbName; //新增在操作后记日志,修改删除在操作前记日志
                la.Key = pkField;
                la.Value = FID;
                ApplyLogAction(tran, la);
            }
            RDFNew.Module.DALEntity.QuerySet qs = new RDFNew.Module.DALEntity.QuerySet();
            qs.QueryInfos.Add(new RDFNew.Module.DALEntity.QueryInfo(pkField, "=", FID));
            DataTable dtOrg = GetMaster(tran, tbName, qs);
            string SqlInsert = "";
            System.Text.StringBuilder sbSql = new StringBuilder();
            List<SqlParameter> parms = new List<SqlParameter>();
            sbSql.Append("Update  " + tbName + " Set ");
            int chg = 0;
            foreach (DataColumn dc in dtOrg.Columns)
            {
                if (!dr[dc.ColumnName].Equals(dtOrg.Rows[0][dc.ColumnName]))
                {
                    sbSql.Append("[" + dc.ColumnName + "]=@" + dc.ColumnName + ",");
                    parms.Add(new SqlParameter("@" + dc.ColumnName, dr[dc.ColumnName]));
                    chg++;
                }
            }
            if (chg > 0)
            {
                SqlInsert = sbSql.ToString().TrimEnd(',') + " Where " + pkField + "=@" + pkField + " ";
                parms.Add(new SqlParameter("@" + pkField, FID));
                SqlHelper.ExecuteNonQuery(tran, CommandType.Text, SqlInsert, parms.ToArray());
            }

            return FID;
        }