public static EntityData GetGradeConsiderDepartmentByCode(string code, StandardEntityDAO dao)
        {
            EntityData data2;

            try
            {
                data2 = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #2
0
        public static EntityData GetBiddingLogByCode(string code, StandardEntityDAO dao)
        {
            EntityData data2;

            try
            {
                data2 = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #3
0
 public static void Update(StampDuty StampDuty)
 {
     using (StandardEntityDAO ydao = new StandardEntityDAO("StampDuty"))
     {
         EntityData entitydata = ydao.SelectbyPrimaryKey(StampDuty.StampDutyID);
         DataRow    currentRow = entitydata.CurrentRow;
         currentRow["TaxItems"] = StampDuty.TaxItems;
         currentRow["Range"]    = StampDuty.Range;
         currentRow["TaxRate"]  = StampDuty.TaxRate;
         currentRow["TaxPayer"] = StampDuty.TaxPayer;
         currentRow["Remarks"]  = StampDuty.Remarks;
         ydao.SubmitEntity(entitydata);
     }
 }
Beispiel #4
0
        private EntityData GetOACachetByCode(StandardEntityDAO dao, string code)
        {
            EntityData data2;

            try
            {
                dao.EntityName = "OACachet";
                data2          = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #5
0
        private EntityData GetBidding_SupplierDepartmentIdeaByCode(StandardEntityDAO dao, string code)
        {
            EntityData data2;

            try
            {
                dao.EntityName = "Bidding_SupplierDepartmentIdea";
                data2          = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #6
0
        public static EntityData GetLeaveByCode(StandardEntityDAO dao, string code)
        {
            EntityData data2;

            try
            {
                dao.EntityName = "Leave";
                data2          = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #7
0
        public static EntityData GetPurchaseFlowCheckListByCode(StandardEntityDAO dao, string code)
        {
            EntityData data2;

            try
            {
                dao.EntityName = "PurchaseFlowCheckList";
                data2          = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
        private EntityData GetPurchaseFlowSelSupplyHistoryByCode(StandardEntityDAO dao, string code)
        {
            EntityData data2;

            try
            {
                dao.EntityName = "PurchaseFlowSelSupplyHistory";
                data2          = dao.SelectbyPrimaryKey(code);
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #9
0
        public static EntityData GetPic_StoreByCode(string code)
        {
            EntityData data2;

            try
            {
                EntityData data;
                using (StandardEntityDAO ydao = new StandardEntityDAO("PIC_STORE"))
                {
                    data = ydao.SelectbyPrimaryKey(code);
                }
                data2 = data;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #10
0
        private static EntityData ImportSalClientByClient(string ClientCode, string ProjectCode, DataSet dsSrc, StandardEntityDAO dao)
        {
            EntityData data2;

            try
            {
                DataRow   row;
                DataTable table = dsSrc.Tables["Client"];
                DataRow   row2  = table.Rows[0];
                dao.EntityName = "SalClient";
                EntityData entitydata = new EntityData("SalClient");
                entitydata = dao.SelectbyPrimaryKey(ClientCode);
                if (entitydata.HasRecord())
                {
                    row = entitydata.CurrentTable.Rows[0];
                }
                else
                {
                    row = entitydata.CurrentTable.NewRow();
                }
                row["ProjectCode"] = ProjectCode;
                row["ClientCode"]  = row2["client_code"];
                row["ClientName"]  = row2["client_name"];
                if (!entitydata.HasRecord())
                {
                    entitydata.AddNewRecord(row);
                    dao.InsertEntity(entitydata);
                }
                else
                {
                    dao.UpdateEntity(entitydata);
                }
                data2 = entitydata;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
        public static EntityData GetGradeDepartmentPercentageByCode(string code, StandardEntityDAO dao)
        {
            EntityData data2;

            try
            {
                EntityData gradeDepartmentPercentageByCode;
                if (dao != null)
                {
                    dao.EntityName = "GradeDepartmentPercentage";
                    gradeDepartmentPercentageByCode = dao.SelectbyPrimaryKey(code);
                }
                else
                {
                    gradeDepartmentPercentageByCode = GetGradeDepartmentPercentageByCode(code);
                }
                data2 = gradeDepartmentPercentageByCode;
            }
            catch (Exception exception)
            {
                throw exception;
            }
            return(data2);
        }
Beispiel #12
0
        private void ImportSalContract(string[] m_strSub, string ContractCode, string ProjectCode, StandardEntityDAO dao)
        {
            try
            {
                dao.EntityName = "SalContract";
                EntityData entity = new EntityData("SalContract");
                entity = dao.SelectbyPrimaryKey(ContractCode);
                DataRow dr;

                if (entity.HasRecord())
                {
                    dr = entity.CurrentTable.Rows[0];
                }
                else
                {
                    dr = entity.CurrentTable.NewRow();
                }

                dr["ProjectCode"]  = ProjectCode;
                dr["ContractCode"] = ContractCode;
                dr["ContractID"]   = m_strSub[2];
                dr["ClientName"]   = m_strSub[1];
                dr["Room"]         = m_strSub[6];

                try
                {
                    dr["UnitPrice"] = decimal.Parse(m_strSub[8]);
                }
                catch
                {
                    dr["UnitPrice"] = 0;
                }

                dr["BofangCode"]   = m_strSub[3];
                dr["BuildingName"] = m_strSub[4];
                dr["ChamberName"]  = m_strSub[5];

                try
                {
                    dr["BuildDim"] = decimal.Parse(m_strSub[7]);
                }
                catch
                {
                    dr["BuildDim"] = 0;
                }

                //按合同号取供应商代码
                //					string SuplName = GetSuplNameByContract(dr["ContractID"].ToString());
                //					string SuplCode = GetSuplCodeByName(SuplName, ProjectCode);
                //					dr["SuplCode"] = SuplCode;

                if (!entity.HasRecord())
                {
                    entity.AddNewRecord(dr);
                    dao.InsertEntity(entity);
                }
                else
                {
                    dao.UpdateEntity(entity);
                }

                entity.Dispose();
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Beispiel #13
0
        public static void DeleteSystemGroup(string GroupCode)
        {
            Exception exception;

            try
            {
                if (GroupCode != "")
                {
                    string message = CheckDeleteSystemGroup(GroupCode);
                    if (message != "")
                    {
                        throw new Exception(message);
                    }
                    EntityData systemGroupByCode = SystemManageDAO.GetSystemGroupByCode(GroupCode);
                    if (systemGroupByCode.HasRecord())
                    {
                        string    keyvalues;
                        string    parentFullID = systemGroupByCode.GetString("FullID");
                        DataTable table        = new DataTable();
                        table.Columns.Add("AccessRangeCode");
                        EntityData systemGroupIncludeAllChildByParentFullID = SystemManageDAO.GetSystemGroupIncludeAllChildByParentFullID(parentFullID);
                        foreach (DataRow row in systemGroupIncludeAllChildByParentFullID.CurrentTable.Rows)
                        {
                            EntityData accessRangeByGroupCode = ResourceDAO.GetAccessRangeByGroupCode(row["GroupCode"].ToString());
                            foreach (DataRow row2 in accessRangeByGroupCode.CurrentTable.Rows)
                            {
                                keyvalues = row2["AccessRangeCode"].ToString();
                                DataRow row3 = table.NewRow();
                                row3["AccessRangeCode"] = keyvalues;
                                table.Rows.Add(row3);
                            }
                            accessRangeByGroupCode.Dispose();
                        }
                        using (StandardEntityDAO ydao = new StandardEntityDAO("SystemGroup"))
                        {
                            ydao.BeginTrans();
                            try
                            {
                                foreach (DataRow row3 in table.Rows)
                                {
                                    keyvalues       = row3["AccessRangeCode"].ToString();
                                    ydao.EntityName = "AccessRange";
                                    EntityData entitydata = new EntityData("AccessRange");
                                    entitydata = ydao.SelectbyPrimaryKey(keyvalues);
                                    ydao.DeleteAllRow(entitydata);
                                    ydao.DeleteEntity(entitydata);
                                    entitydata.Dispose();
                                }
                                foreach (DataRow row3 in systemGroupIncludeAllChildByParentFullID.CurrentTable.Rows)
                                {
                                    string text3 = row3["GroupCode"].ToString();
                                    ydao.EntityName = "SystemGroup";
                                    EntityData data5 = new EntityData("SystemGroup");
                                    data5 = ydao.SelectbyPrimaryKey(text3);
                                    ydao.DeleteAllRow(data5);
                                    ydao.DeleteEntity(data5);
                                    data5.Dispose();
                                }
                                ydao.CommitTrans();
                            }
                            catch (Exception exception1)
                            {
                                exception = exception1;
                                try
                                {
                                    ydao.RollBackTrans();
                                }
                                catch
                                {
                                }
                                throw exception;
                            }
                        }
                        systemGroupIncludeAllChildByParentFullID.Dispose();
                    }
                    systemGroupByCode.Dispose();
                }
            }
            catch (Exception exception2)
            {
                exception = exception2;
                throw exception;
            }
        }