/// <summary>
        /// 提交今日工作日志
        /// </summary>
        /// <param name="list1"></param>
        /// <returns></returns>
        public bool UpdateTodayLog(List <KORWeb.DDL.Tb_WorkLogDD> list1)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                List <SearchField>          condition = new List <SearchField>();
                Tb_WorkLogDA                da1       = new Tb_WorkLogDA();
                Dictionary <String, object> dic1      = new Dictionary <string, object>();
                foreach (Tb_WorkLogDD d1 in list1)
                {
                    condition.Clear();
                    condition.Add(new SearchField("AddUserID", d1.AddUserID));
                    condition.Add(new SearchField("parentGuid", d1.ParentGuid));
                    condition.Add(new SearchField("PlanID", d1.PlanID));
                    condition.Add(new SearchField("PlanNum", d1.PlanNum));
                    String t1 = "CDate('" + d1.BegDate.ToString("yyyy-MM-dd") + "')";
                    condition.Add(new SearchField("begDate", t1, SearchFieldType.NumericType));

                    dic1.Clear();

                    //修改数据
                    if (da1.HasData(condition))
                    {
                        dic1["LogContent"] = d1.LogContent;
                        dic1["WorkLoad"]   = d1.WorkLoad;
                        da1.EditData(condition, dic1);
                    }
                    else
                    {
                        dic1["LogContent"] = d1.LogContent;
                        dic1["WorkLoad"]   = d1.WorkLoad;
                        if (d1.LogContent.Length > 0 && d1.WorkLoad > 0)
                        {
                            dic1["LogContent"]  = d1.LogContent;
                            dic1["WorkLoad"]    = d1.WorkLoad;
                            dic1["parentGuid"]  = d1.ParentGuid;
                            dic1["PlanID"]      = d1.PlanID;
                            dic1["PlanNum"]     = d1.PlanNum;
                            dic1["AddUserID"]   = d1.AddUserID;
                            dic1["AddUserName"] = d1.AddUserName;
                            dic1["begDate"]     = d1.BegDate;
                            dic1["Addtime"]     = d1.AddTime;
                            dic1["LogID"]       = WebFrame.Util.JString.GetUnique32ID();
                            da1.NewData(dic1);
                        }
                    }
                }
                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
                succ = false;
            }

            return(succ);
        }
Пример #2
0
        /// <summary>
        /// 删除用户数据,同时删除其相关数据
        /// 提示:此功能,可能会根据不同的项目重写
        /// </summary>
        /// <param name="AreaCode"></param>
        public bool DeleteData(String UserID)
        {
            bool succ = false;

            if (String.IsNullOrEmpty(UserID) == false)
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("UserID", UserID, SearchOperator.Collection));

                JConnect conn1 = JConnect.GetConnect();
                conn1.BeginTrans();
                try
                {
                    //JRoleUsersDA da1 = new JRoleUsersDA(conn1);
                    //da1.DeleteData(condition);

                    //JOrgUsersDA da2 = new JOrgUsersDA(conn1);
                    //da2.DeleteData(condition);

                    JUserDA da3 = new JUserDA();
                    da3.DeleteData(condition);

                    //删除其他的相关业务表
                    conn1.CommitTrans();
                    succ = true;
                }
                catch (Exception err)
                {
                    JTool.WriteErrorLog(err.Message);
                    conn1.RollBackTrans();
                }
            }
            return(succ);
        }
        /// <summary>
        /// 删除工作日志
        /// </summary>
        /// <param name="DataID"></param>
        /// <returns></returns>
        public bool DeleteData(String DataID)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("LogID", DataID));
                Tb_WorkLogDA da1 = new Tb_WorkLogDA();
                da1.DeleteData(condition);

                condition.Clear();
                condition.Add(new SearchField("ParentID", DataID));
                Tb_WorkLogReadersDA da2 = new Tb_WorkLogReadersDA();
                da2.DeleteData(condition);

                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
            }
            return(succ);
        }
Пример #4
0
        /// <summary>
        /// 删除系统条目
        /// </summary>
        /// <param name="ItemName">条目名称</param>
        /// <returns></returns>
        public bool DeleteData(String ItemName)
        {
            bool succ = false;

            if (String.IsNullOrEmpty(ItemName) == false)
            {
                try
                {
                    JConnect.GetConnect().BeginTrans();
                    JItemDA            da1       = new JItemDA();
                    List <SearchField> condition = new List <SearchField>();
                    condition.Add(new SearchField("ItemName", ItemName));
                    da1.DeleteData(condition);

                    JItemDetailDA da2 = new JItemDetailDA();
                    da2.DeleteData(condition);
                    JConnect.GetConnect().CommitTrans();
                    succ = true;
                }
                catch (Exception err)
                {
                    JConnect.GetConnect().RollBackTrans();
                }
            }
            return(succ);
        }
Пример #5
0
        /// <summary>
        /// 用户接单
        /// </summary>
        /// <param name="guidid"></param>
        /// <returns></returns>
        public bool ReceiveTask(String guidid)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                //1--更改工单中的数据
                Dictionary <String, object> dic1 = new Dictionary <string, object>();
                dic1["ExecuteMan"] = FrameLib.UserID;
                dic1["Status"]     = "1";
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("GuidID", guidid));
                Tb_TaskDA da1 = new Tb_TaskDA();
                da1.EditData(condition, dic1);


                //如操作成功,则插入派工单的日志
                //2--创建工单日志
                (new Tb_Task_LogBU()).NewLog(guidid, FrameLib.UserID + "承接工单", "", "0", null);

                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                WebFrame.Util.JTool.WriteErrorLog(err.ToString());
                JConnect.GetConnect().RollBackTrans();
                succ = false;
            }
            return(succ);
        }
Пример #6
0
        /// <summary>
        /// 删除派工单,同时删除其中包含的附件
        /// 上传派工单的日志和日志包含的附件
        /// </summary>
        /// <param name="guidid"></param>
        /// <returns></returns>
        public bool DeleteData(String guidid)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                //1--删除派工单
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("Guidid", guidid));
                Tb_TaskDA da1 = new Tb_TaskDA();
                DataRow   dr1 = da1.GetFirstDataRow(condition, "*");
                if (dr1 != null)
                {
                    //删除相关附件
                    String filename1 = dr1["RelaFile"].ToString();
                    if (String.IsNullOrEmpty(filename1) == false)
                    {
                        filename1 = System.Web.HttpContext.Current.Server.MapPath(filename1);
                        if (File.Exists(filename1))
                        {
                            File.Delete(filename1);
                        }
                    }

                    //删除数据
                    da1.DeleteData(condition);
                }

                //2--删除派工单的日志
                condition.Clear();
                condition.Add(new SearchField("parentGuid", guidid));
                Tb_Task_LogDA da2 = new Tb_Task_LogDA();
                DataTable     dt1 = da2.GetListData(condition, -1, -1, "", "*");
                foreach (DataRow dr0 in dt1.Rows)
                {
                    String filename1 = dr0["RelateFile"].ToString();
                    if (String.IsNullOrEmpty(filename1) == false)
                    {
                        filename1 = System.Web.HttpContext.Current.Server.MapPath(filename1);
                        if (File.Exists(filename1))
                        {
                            File.Delete(filename1);
                        }
                    }
                }
                da2.DeleteData(condition);

                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
                WebFrame.Util.JTool.WriteErrorLog(err.ToString());
            }
            return(succ);
        }
        protected void ImportExcel(string FilePath, string SheetName)
        {
            JTable tab  = new JTable("NEWTRAIN");
            JTable tab1 = new JTable("NEWTRAIN");

            String FileName1 = HttpContext.Current.Server.MapPath(FilePath);

            if (File.Exists(FileName1))
            {
                DataSet                     ds1       = BusinessRule.PubCode.Util.xsldata(Server.MapPath(FilePath), SheetName);
                List <SearchField>          condition = new List <SearchField>();
                Dictionary <string, object> data      = new Dictionary <string, object>();
                if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
                {
                    int      n   = ds1.Tables[0].Columns.Count;
                    JCommand cmd = new JCommand(JConnect.GetConnect());
                    cmd.CommandText = "select max(num) from NEWTRAIN";
                    int num = Convert.ToInt32(cmd.ExecuteScalar());
                    cmd.Close();
                    for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                    {
                        condition.Clear();
                        condition.Add(new SearchField("TRAINNAME", ds1.Tables[0].Rows[i]["车次"].ToString()));
                        data.Clear();
                        data.Add("TRAINNAME", ds1.Tables[0].Rows[i]["车次"].ToString());
                        data.Add("ASTATION", ds1.Tables[0].Rows[i]["始发站"].ToString());
                        data.Add("BSTATION", ds1.Tables[0].Rows[i]["终到站"].ToString());
                        data.Add("TRAINBIGKIND", 0);
                        data.Add("TRAINTYPE", ds1.Tables[0].Rows[i]["列车类型"].ToString());
                        data.Add("MILE", ds1.Tables[0].Rows[i]["单程距离"].ToString());
                        data.Add("KXTS", ds1.Tables[0].Rows[i]["开行趟数"].ToString());
                        data.Add("CDZS", ds1.Tables[0].Rows[i]["车底组数"].ToString());
                        data.Add("YINZUO", ds1.Tables[0].Rows[i]["硬座"].ToString());
                        data.Add("RUANZUO", ds1.Tables[0].Rows[i]["软座"].ToString());
                        data.Add("OPENYINWO", ds1.Tables[0].Rows[i]["硬卧"].ToString());
                        data.Add("RUANWO", ds1.Tables[0].Rows[i]["软卧"].ToString());
                        data.Add("CANCHE", ds1.Tables[0].Rows[i]["餐车"].ToString());
                        data.Add("FADIANCHE", ds1.Tables[0].Rows[i]["发电车"].ToString());
                        data.Add("SHUYINCHE", ds1.Tables[0].Rows[i]["行李车"].ToString());
                        data.Add("YOUZHENGCHE", ds1.Tables[0].Rows[i]["邮政车"].ToString());
                        if (!tab1.HasData(condition))
                        {
                            data.Add("num", Convert.ToInt32(num) + 1);
                            tab.InsertData(data);
                            num++;
                        }
                        else
                        {
                            tab.EditData(data, condition);
                        }
                    }
                }
            }
            tab.Close();
            tab1.Close();
            WebFrame.Util.JAjax.Alert("导入完成!");
        }
Пример #8
0
        //合并担担车收入
        public static int MergeData_SHOUROU()
        {
            JConnect conn1 = JConnect.GetConnect();

            conn1.BeginTrans();
            int    count = 0;
            JTable tab1  = null;

            try
            {
                tab1           = new JTable(conn1, "");
                tab1.TableName = "NEWTRAINSHOUROU";
                tab1.OrderBy   = "byear,bmonth,trainname,astation,bstation";
                DataTable dt1 = tab1.SearchData(null, -1, "*").Tables[0];

                for (int i = dt1.Rows.Count - 1; i > 0; i--)
                {
                    DataRow dr1 = dt1.Rows[i];
                    DataRow dr0 = dt1.Rows[i - 1];
                    if (dr1["byear"].ToString() == dr0["byear"].ToString() &&
                        dr1["bmonth"].ToString() == dr0["bmonth"].ToString() &&
                        dr1["trainname"].ToString() == dr0["trainname"].ToString() &&
                        dr1["astation"].ToString() == dr0["astation"].ToString() &&
                        dr1["bstation"].ToString() == dr0["bstation"].ToString()
                        )
                    {
                        for (int k = 1; k <= 6; k++)
                        {
                            dr0["SHOUROU" + k] = double.Parse(dr0["SHOUROU" + k].ToString())
                                                 + double.Parse(dr1["SHOUROU" + k].ToString());
                        }
                        dr1.Delete();
                        count++;
                    }
                }
                if (count > 0)
                {
                    tab1.Update(dt1);
                }
                conn1.CommitTrans();
            }
            catch (Exception err)
            {
                conn1.RollBackTrans();
                count = 0;
            }
            if (tab1 != null)
            {
                tab1.Close();
            }

            return(count);
        }
        /// <summary>
        /// 保存工作日志
        /// </summary>
        ///
        /// <param name="logid"></param>
        /// <param name="authorid"></param>
        /// <param name="authorName"></param>
        /// <param name="logcontent"></param>
        /// <param name="begdate"></param>
        ///
        /// <returns></returns>
        public int  SaveWorkLog(
            String logid,
            String authorid,
            String authorName,
            String logcontent,
            String begdate)
        {
            int succ = 0;

            JConnect.GetConnect().BeginTrans();
            try
            {
                //1--插入或修改日志
                Dictionary <String, object> dic1 = new Dictionary <string, object>();
                JConnect.GetConnect().CommitTrans();
                dic1["logid"]       = logid;
                dic1["AddUserID"]   = authorid;
                dic1["AddUserName"] = authorName;
                dic1["begdate"]     = DateTime.Parse(begdate);
                dic1["logcontent"]  = logcontent;
                if (DateTime.Parse(begdate).ToString("yyyy-MM-dd") != DateTime.Now.ToString("yyyy-MM-dd"))
                {
                    dic1["IsBuDeng"] = true;
                }
                else
                {
                    dic1["IsBuDeng"] = false;
                }

                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("logid", logid));
                Tb_WorkLogDA da1 = new Tb_WorkLogDA();
                if (da1.HasData(condition))
                {
                    da1.EditData(condition, dic1);
                }
                else
                {
                    da1.NewData(dic1);
                }


                JConnect.GetConnect().CommitTrans();
                succ = 1;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
            }
            return(succ);
        }
        /// <summary>
        /// 项目延期
        /// </summary>
        /// <param name="PrjNum"></param>
        /// <param name="delay"></param>
        /// <param name="Remark"></param>
        /// <returns></returns>
        public bool DelayProjectData(String GuidID, DateTime delay, String Remark)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("GuidID", GuidID));
                condition.Add(new SearchField("Status", "1", SearchFieldType.NumericType));

                //1--更改项目状态
                Tb_ProjectDA da1 = new Tb_ProjectDA();
                if (da1.HasData(condition))
                {
                    Dictionary <String, object> dic1 = new Dictionary <string, object>();
                    //dic1["Status"] = "3";
                    dic1["endDate"] = delay;
                    da1.EditData(condition, dic1);

                    //2--新增项目日志
                    dic1.Clear();
                    dic1["guidid"]     = WebFrame.Util.JString.GetUnique32ID();
                    dic1["parentGuid"] = GuidID;
                    dic1["Stitle"]     = "项目延期";
                    dic1["Content"]    = "项目延期至" + delay.ToString("yyyy-MM-dd") + " 延期说明:" + Remark;

                    dic1["AddTime"]     = DateTime.Now;
                    dic1["AddUserID"]   = FrameLib.UserID;
                    dic1["AddUserName"] = FrameLib.UserName;
                    dic1["Content"]     = Remark;
                    dic1["kind"]        = "0";

                    Tb_Project_LogDA da2 = new Tb_Project_LogDA();
                    da2.NewData(dic1);
                    succ = true;
                }
                JConnect.GetConnect().CommitTrans();
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
                WebFrame.Util.JTool.WriteErrorLog(err.ToString());
            }
            return(succ);
        }
        /// <summary>
        /// 将项目标记为重新返工
        /// </summary>
        /// <param name="GuidID"></param>
        /// <param name="Remark"></param>
        /// <returns></returns>
        public bool ReturnWorkProject(String GuidID, String Remark)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("GuidID", GuidID));
                condition.Add(new SearchField("Status=3 or Status=2", "", SearchOperator.UserDefine));

                //1--更改项目状态
                Tb_ProjectDA da1 = new Tb_ProjectDA();
                if (da1.HasData(condition))
                {
                    Dictionary <String, object> dic1 = new Dictionary <string, object>();
                    dic1["Status"]     = "1";
                    dic1["FinishDate"] = DateTime.Now;
                    da1.EditData(condition, dic1);

                    //2--新增项目日志
                    dic1.Clear();
                    dic1["guidid"]      = WebFrame.Util.JString.GetUnique32ID();
                    dic1["parentGuid"]  = GuidID;
                    dic1["Stitle"]      = "项目返工";
                    dic1["AddTime"]     = DateTime.Now;
                    dic1["AddUserID"]   = FrameLib.UserID;
                    dic1["AddUserName"] = FrameLib.UserName;
                    dic1["Content"]     = Remark;
                    dic1["kind"]        = "0";

                    Tb_Project_LogDA da2 = new Tb_Project_LogDA();
                    da2.NewData(dic1);
                    succ = true;
                }
                JConnect.GetConnect().CommitTrans();
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
                WebFrame.Util.JTool.WriteErrorLog(err.ToString());
            }
            return(succ);
        }
Пример #12
0
        public DataTable GetListData(List <SearchField> condition,
                                     int PageSize, int CurPage, String orderBy,
                                     out int TotalRow, params String[] Fields)
        {
            TotalRow       = 0;
            this.daConnect = JConnect.GetConnect();
            DataTable dt1  = null;
            JTable    tab1 = new JTable(daConnect, TableName);

            tab1.PageSize = PageSize;
            if (String.IsNullOrEmpty(orderBy) == false)
            {
                tab1.OrderBy = orderBy;
            }
            dt1      = tab1.SearchData(condition, CurPage, Fields).Tables[0];
            TotalRow = tab1.GetTotalRow();          //得到总的数据行
            tab1.Close();
            return(dt1);
        }
        /// <summary>
        /// 增加项目组的成员
        /// </summary>
        /// <param name="personid"></param>
        /// <param name="projectGuidid"></param>
        /// <param name="gw"></param>
        /// <returns></returns>
        public bool AddPerson(String personid, String projectGuidid, String gw)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                String[] arr1 = personid.Split(',');
                Dictionary <String, object> dic1      = new Dictionary <string, object>();
                List <SearchField>          condition = new List <SearchField>();

                Tb_Project_PersonDA da1 = new Tb_Project_PersonDA();
                foreach (String m in arr1)
                {
                    condition.Clear();
                    condition.Add(new SearchField("parentGuid", projectGuidid));
                    condition.Add(new SearchField("UserID", m));
                    if (da1.HasData(condition))
                    {
                        dic1.Clear();
                        dic1["PrjRole"] = gw;
                        da1.EditData(condition, dic1);
                    }
                    else
                    {
                        dic1.Clear();
                        dic1["parentGuid"] = projectGuidid;
                        dic1["UserID"]     = m;
                        dic1["UserName"]   = JUserBU.GetUserNamByIDS(m);
                        dic1["PrjRole"]    = gw;
                        dic1["GuidID"]     = JString.GetUnique32ID();
                        da1.NewData(dic1);
                    }
                }
                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
            }
            return(succ);
        }
Пример #14
0
        /// <summary>
        /// 删除系统条目
        /// </summary>
        /// <param name="ItemName">条目ID</param>
        /// <returns></returns>
        public bool DeleteData(String strID)
        {
            bool succ = false;

            if (String.IsNullOrEmpty(strID) == false)
            {
                try
                {
                    JStrInfoDA         da1       = new JStrInfoDA();
                    List <SearchField> condition = new List <SearchField>();
                    condition.Add(new SearchField("StrID", strID));
                    da1.DeleteData(condition);
                    succ = true;
                }
                catch (Exception err)
                {
                    JConnect.GetConnect().RollBackTrans();
                }
            }
            return(succ);
        }
Пример #15
0
        public static string GetIPs()
        {
            daConnect = JConnect.GetConnect();

            JTable tab1 = new JTable(daConnect, TableName);

            List <SearchField> condition = new List <SearchField>();

            condition.Add(new SearchField("STRID", "KIP"));
            bool    hasdata = tab1.HasData(condition);
            DataRow data1   = tab1.GetFirstDataRow(condition, "STRTEXT");

            tab1.Close();

            if (!hasdata)
            {
                return("");
            }
            else
            {
                return(data1["STRTEXT"].ToString().Trim());
            }
        }
Пример #16
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="condition"></param>
        /// <param name="corpDic"></param>
        public static bool SetIPs(string ips)
        {
            bool   succ = false;
            String sql  = "update JSTRINFO set STRTEXT='" + ips + "' where STRID = 'KIP'";

            JCommand comm = new JCommand();

            List <SearchField> condition = new List <SearchField>();

            condition.Add(new SearchField("STRID", "KIP"));

            daConnect = JConnect.GetConnect();
            JTable tab1    = new JTable(daConnect, TableName);
            bool   hasdata = tab1.HasData(condition);

            if (!hasdata)
            {
                String insertsql = "insert into jstrinfo (STRID)values ('KIP')";
                comm.CommandText = insertsql;
                comm.ExecuteNoQuery();
            }

            comm.CommandText = sql;

            try
            {
                comm.ExecuteNoQuery();
                succ = true;
            }
            catch (Exception err)
            {
                succ = false;
            }

            return(succ);
        }
Пример #17
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JUserUrlDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_KaoHeOtherDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #19
0
        //合并数据
        /// <summary>
        /// kind=0 --- 担担车收入
        /// kind=1 --- 线路使用费
        /// kind=2 --- 机车牵引费
        /// kind=3 --- 电网和接触网费
        /// kind=4 --- 列车运输人数
        /// </summary>
        /// <param name="kind"></param>
        /// <returns></returns>
        public static int MergeData(int kind)
        {
            JConnect conn1 = JConnect.GetConnect();

            conn1.BeginTrans();
            int    count     = 0;
            JTable tab1      = null;
            String tableName = String.Empty;

            String[] fs = null;

            if (kind == 0)
            {
                tableName = "NEWTRAINSHOUROU";
                fs        = new String[] { "SHOUROU1", "SHOUROU2", "SHOUROU3", "SHOUROU4", "SHOUROU5", "SHOUROU6" };
            }
            else if (kind == 1)
            {
                tableName = "NEWTRAINXIANLUFEE";
                fs        = new String[] { "GONGLI1", "GONGLI2", "GONGLI3", "FEE1", "FEE2", "FEE3" };
            }
            else if (kind == 2)
            {
                tableName = "NEWTRAINQIANYINFEE";
                fs        = new String[] { "ZL1", "ZL2", "ZL3", "FEE1", "FEE2", "FEE3" };
            }
            else if (kind == 3)
            {
                tableName = "NEWTRAINSERVERPEOPLE";
                fs        = new String[] { "PC1", "PC2", "PC3", "FEE1", "FEE2", "FEE3" };
            }

            if (String.IsNullOrEmpty(tableName) == false)
            {
                try
                {
                    tab1           = new JTable(conn1, "");
                    tab1.TableName = tableName;
                    tab1.OrderBy   = "byear,bmonth,trainname,astation,bstation";
                    DataTable dt1 = tab1.SearchData(null, -1, "*").Tables[0];

                    for (int i = dt1.Rows.Count - 1; i > 0; i--)
                    {
                        DataRow dr1 = dt1.Rows[i];
                        DataRow dr0 = dt1.Rows[i - 1];
                        if (dr1["byear"].ToString() == dr0["byear"].ToString() &&
                            dr1["bmonth"].ToString() == dr0["bmonth"].ToString() &&
                            dr1["trainname"].ToString() == dr0["trainname"].ToString() &&
                            dr1["astation"].ToString() == dr0["astation"].ToString() &&
                            dr1["bstation"].ToString() == dr0["bstation"].ToString()
                            )
                        {
                            foreach (String m in fs)
                            {
                                dr0[m] = double.Parse(dr0[m].ToString()) + double.Parse(dr1[m].ToString());
                            }
                            dr1.Delete();
                            count++;
                        }
                    }
                    if (count > 0)
                    {
                        tab1.Update(dt1);
                    }
                    conn1.CommitTrans();
                }
                catch (Exception err)
                {
                    conn1.RollBackTrans();
                    count = 0;
                }
                if (tab1 != null)
                {
                    tab1.Close();
                }
            }

            return(count);
        }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JItemDetailDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JUserActionLogDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #22
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JModelDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_Task_LogDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #24
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_PlanDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_Project_LogDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #26
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_KH_Project_PersonDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #27
0
        /// <summary>
        /// 调整加权系数后,重新计算项目的贡献度数据
        /// </summary>
        /// <param name="DataID"></param>
        /// <returns></returns>
        public bool RecalProjectGXDData(String DataID)
        {
            bool succ = false;

            JConnect.GetConnect().BeginTrans();
            try
            {
                List <SearchField> condition = new List <SearchField>();
                condition.Add(new SearchField("DataID", DataID, SearchFieldType.NumericType));
                Tb_KH_Project_PersonDA      da1  = new Tb_KH_Project_PersonDA();
                Dictionary <String, object> dic1 = da1.GetFirstDictionary(condition, "*");
                if (dic1 != null && dic1.Count > 0)
                {
                    String ParentID = dic1["ParentID"].ToString();

                    //得到项目的总金额
                    double       hsmoney = 0;
                    Tb_ProjectDA da0     = new Tb_ProjectDA();
                    condition.Clear();
                    condition.Add(new SearchField("GuidID", ParentID));
                    dic1 = da0.GetFirstDictionary(condition, "HSMoney");
                    if (dic1 != null && dic1.Count > 0)
                    {
                        double.TryParse(dic1["HSMoney"].ToString(), out hsmoney);
                    }

                    //得到项目总的有效工作量
                    double sumwk = 0;
                    condition.Clear();
                    condition.Add(new SearchField("ParentID", ParentID));
                    DataTable dt = da1.GetListData(condition, -1, -1, "DataID", "*");
                    foreach (DataRow dr1 in dt.Rows)
                    {
                        if (String.IsNullOrEmpty(dr1["factWorkLoad"].ToString()) == false)
                        {
                            sumwk = sumwk + double.Parse(dr1["factWorkLoad"].ToString());
                        }
                    }
                    if (sumwk == 0)
                    {
                        sumwk = 1;
                    }

                    //成批的更新数据
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        dic1.Clear();
                        DataRow dr1 = dt.Rows[i];
                        double  t1  = Math.Round(double.Parse(dr1["factWorkLoad"].ToString()) * 100 / sumwk, 2);
                        dic1["GxRate"]  = t1;
                        dic1["GxMoney"] = t1 * hsmoney / 100;
                        condition.Clear();
                        condition.Add(new SearchField("DataID", dr1["DataID"].ToString(), SearchFieldType.NumericType));
                        da1.EditData(condition, dic1);
                    }
                }

                JConnect.GetConnect().CommitTrans();
                succ = true;
            }
            catch (Exception err)
            {
                JConnect.GetConnect().RollBackTrans();
                JTool.WriteErrorLog(err.ToString());
            }

            return(succ);
        }
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public Tb_PL_MonthDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #29
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JAuthorityDetailDA()
 {
     this.daConnect = JConnect.GetConnect();
 }
Пример #30
0
 /// <summary>
 /// 无参数构造函数
 /// </summary>
 public JLogDA()
 {
     this.daConnect = JConnect.GetConnect();
 }