internal static void Merge(DataSet targetSet, DataRow[] sourceRows, bool preserveChanges, MissingSchemaAction missingSchemaAction)
		{
			if(targetSet == null)
				throw new ArgumentNullException("targetSet");
			if(sourceRows == null)
				throw new ArgumentNullException("sourceRows");

			bool savedEnfoceConstraints = targetSet.EnforceConstraints;
			targetSet.EnforceConstraints = false;

			ArrayList targetTables = new ArrayList();
			for (int i = 0; i < sourceRows.Length; i++) {
				DataRow row = sourceRows[i];
				DataTable sourceTable = row.Table;
				DataTable targetTable = null;
				if (!AdjustSchema(targetSet, sourceTable, missingSchemaAction,ref targetTable)) {
					return;
				}
				if (targetTable != null) {
					checkColumnTypes(targetTable, row.Table);
					MergeRow(targetTable, row, preserveChanges);
					if (!(targetTables.IndexOf(targetTable) >= 0)) {
						targetTables.Add(targetTable);
					}
				}
			}

			targetSet.EnforceConstraints = savedEnfoceConstraints;

			foreach(DataTable table in targetTables) {
				table.ResetIndexes();
			}
		}
        private static void ApplyFyCzInterService(DataRow drRow)
        {
            AutoPlanEntity _autohotelplanEntity = new AutoPlanEntity();
            _autohotelplanEntity.AutoHotelPlanDBEntity = new List<AutoHotelPlanDBEntity>();
            AutoHotelPlanDBEntity appcontentDBEntity = new AutoHotelPlanDBEntity();
            _autohotelplanEntity.AutoHotelPlanDBEntity.Add(appcontentDBEntity);

            string AgentID = ConfigurationManager.AppSettings["AgentID"].ToString();
            string Money = ConfigurationManager.AppSettings["FYMON"].ToString();

            appcontentDBEntity.AgentId = AgentID;
            appcontentDBEntity.Money = Money;
            appcontentDBEntity.OrderId = drRow["RESVID"].ToString().Trim();
            appcontentDBEntity.MobileNum = drRow["MOBILE"].ToString().Trim();
            appcontentDBEntity.UNIT_ID = drRow["UNIT_ID"].ToString().Trim();
            appcontentDBEntity.ORDER_STATUS = drRow["ORDER_STATUS"].ToString().Trim();
            appcontentDBEntity.NAME = drRow["NAME"].ToString().Trim();
            appcontentDBEntity.ARRD = drRow["ARRD"].ToString().Trim();
            appcontentDBEntity.DEPD = drRow["DEPD"].ToString().Trim();
            appcontentDBEntity.CHANNEL = drRow["CHANNEL"].ToString().Trim();
            appcontentDBEntity.PLATFORM_CODE = drRow["PLATFORM_CODE"].ToString().Trim();
            appcontentDBEntity.GUEST_ID = drRow["GUEST_TD"].ToString().Trim(); ;

            _autohotelplanEntity.AutoHotelPlanDBEntity.Add(appcontentDBEntity);
            AutoHotelPlanSA.ApplyFYCZInterface(_autohotelplanEntity);
        }
        public void DataToField(DataRow row, object record) // TypedReference t)
        {
            try
            {
                GetColumnIndex(row);

                if (mCheckTypeFlag == 0)
                {
                    mColumnType = row.Table.Columns[mDataColumnIndex].DataType;
                    if (mColumnType == mField.FieldType)
                        mCheckTypeFlag = 1;
                    else
                        mCheckTypeFlag = 2;
                }

                if (mCheckTypeFlag == 1)
                    mField.SetValue(record, row[mDataColumnIndex]);
                else if (row[mDataColumnIndex] != DBNull.Value)
                    mField.SetValue(record, Convert.ChangeType(row[mDataColumnIndex], mField.FieldType));
                else // IS DB NULl
                {
                    if (mColumnType == typeof (string))
                        mField.SetValue(record, string.Empty);
                }
            }
            catch
            {
                throw new FileHelpersException(string.Format("Error converting value: {0} to {1} in the column with index {2} and the field {3}", row[mDataColumnIndex], mField.FieldType, mDataColumnIndex, mField.Name));
            }
        }
Example #4
1
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public HisClient.Model.his_comm_dict_type DataRowToModel(DataRow row)
 {
     HisClient.Model.his_comm_dict_type model=new HisClient.Model.his_comm_dict_type();
     if (row != null)
     {
         if(row["ID"]!=null)
         {
             model.ID=row["ID"].ToString();
         }
         if(row["TYPE_CODE"]!=null)
         {
             model.TYPE_CODE=row["TYPE_CODE"].ToString();
         }
         if(row["TYPE_NAME"]!=null)
         {
             model.TYPE_NAME=row["TYPE_NAME"].ToString();
         }
         if(row["HELP_CODE"]!=null)
         {
             model.HELP_CODE=row["HELP_CODE"].ToString();
         }
         if(row["CREATE_DATE"]!=null && row["CREATE_DATE"].ToString()!="")
         {
             model.CREATE_DATE=DateTime.Parse(row["CREATE_DATE"].ToString());
         }
         if(row["CREATE_BY"]!=null)
         {
             model.CREATE_BY=row["CREATE_BY"].ToString();
         }
     }
     return model;
 }
        public override void DataBind(DataRow row)
        {
            base.DataBind(row);

            this.PONum = (int)row["PONum"].GetInt();
            this.PONumber = (string)row["PONumber"].GetString();
        }
 public void FillForm()
 {
     da.Fill(ds, "members");
     row = ds.Tables[0].Rows[0];
     TextBox1.Text = row["name"].ToString();
     TextBox2.Text = row["email"].ToString();
     TextBox3.Text = row["contact"].ToString();
     TextBox4.Text = row["college"].ToString();
     TextBox5.Text = row["branch"].ToString();
     TextBox6.Text = row["course"].ToString();
     TextBox7.Text = row["company"].ToString();
     TextBox8.Text = row["company_location"].ToString();
     TextBox9.Text = row["password"].ToString();
     if (row["gender"].Equals("M"))
         RadioButton2.Checked = true;
     else
         RadioButton1.Checked = true;
     if (row["membership"].Equals("S"))
         RadioButton3.Checked = true;
     else
         RadioButton4.Checked = true;
     for(int i=DateTime.Now.Year;i>=1950;i--)
         DropDownList1.Items.Add("" + i);
     DropDownList1.SelectedValue = row["year_of_passing"].ToString();
 }
Example #7
1
 public virtual void DataBind(DataRow row)
 {
     this.CommodityCode = (string)row["Key1"];
     this.CommodityName = (string)row["Character01"];
     this.CoatingRequire = Convert.ToBoolean(row["CheckBox01"].GetBoolean());
     this.LicenceRequire = Convert.ToBoolean(row["CheckBox02"].GetBoolean());
 }
Example #8
1
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public ECommerce.Admin.Model.Logs DataRowToModel(DataRow row)
 {
     ECommerce.Admin.Model.Logs model = new ECommerce.Admin.Model.Logs();
     if (row != null)
     {
         if (row["LID"] != null && row["LID"].ToString() != "")
         {
             model.LID = Convert.ToInt64(row["LID"].ToString());
         }
         if (row["LLID"] != null && row["LLID"].ToString() != "")
         {
             model.LLID = Convert.ToInt64(row["LLID"].ToString());
         }
         if (row["OValue"] != null)
         {
             model.OValue = row["OValue"].ToString();
         }
         if (row["NValue"] != null)
         {
             model.NValue = row["NValue"].ToString();
         }
         if (row["FName"] != null)
         {
             model.FName = row["FName"].ToString();
         }
     }
     return model;
 }
Example #9
1
        public ElectricityParameter(DataRow row)
        {
            this.ID = (int)row["ID"];

            if (row["PowerRate"] != DBNull.Value)
                this.PowerRate = (Double)row["PowerRate"];

            if (row["CoActiveCopperLoss"] != DBNull.Value)
                this.CoActiveCopperLoss = (Double)row["CoActiveCopperLoss"];

            if (row["CoActiveNoloadLoss"] != DBNull.Value)
                this.CoActiveNoloadLoss = (Double)row["CoActiveNoloadLoss"];

            if (row["CoReactiveCopperLoss"] != DBNull.Value)
                this.CoReactiveCopperLoss = (Double)row["CoReactiveCopperLoss"];

            if (row["CoReactiveNoloadLoss"] != DBNull.Value)
                this.CoReactiveNoloadLoss = (Double)row["CoReactiveNoloadLoss"];

            if (row["PriceSpike"] != DBNull.Value)
                this.PriceSpike = (Double)row["PriceSpike"];

            if (row["PricePeak"] != DBNull.Value)
                this.PricePeak = (Double)row["PricePeak"];

            if (row["PriceValley"] != DBNull.Value)
                this.PriceValley = (Double)row["PriceValley"];
        }
Example #10
1
 public static Pet GetPetFromDatabaseRow(DataRow Row)
 {
     return new Pet((uint)Row["id"], (string)Row["name"], (int)Row["type"], (int)Row["race"],
         (uint)Row["user_id"], (uint)Row["room_id"], Vector3.FromString((string)Row["room_pos"]),
         (double)Row["timestamp"], (int)Row["experience"], (int)Row["energy"], (int)Row["happiness"],
         (int)Row["score"]);
 }
 public UCPersonnelAddOrEdit(DataRow dr, string parentName)
 {
     InitializeComponent();
     this.dr = dr;
     this.parentName = parentName;
     Update = new UpdateDele(DBHelper.WebServHandlerByFun);
 }
 public static DbProviderFactory GetFactory(DataRow providerRow)
 {
     ADP.CheckArgumentNull(providerRow, "providerRow");
     DataColumn column = providerRow.Table.Columns["AssemblyQualifiedName"];
     if (column != null)
     {
         string str = providerRow[column] as string;
         if (!ADP.IsEmpty(str))
         {
             Type type = Type.GetType(str);
             if (null == type)
             {
                 throw ADP.ConfigProviderNotInstalled();
             }
             FieldInfo field = type.GetField("Instance", BindingFlags.Public | BindingFlags.Static | BindingFlags.DeclaredOnly);
             if ((null != field) && field.FieldType.IsSubclassOf(typeof(DbProviderFactory)))
             {
                 object obj2 = field.GetValue(null);
                 if (obj2 != null)
                 {
                     return (DbProviderFactory) obj2;
                 }
             }
             throw ADP.ConfigProviderInvalid();
         }
     }
     throw ADP.ConfigProviderMissing();
 }
Example #13
1
 public virtual void DataBind(DataRow row)
 {
     this.PONum = (int)row["PONum"].GetInt();
     this.Revision = (int)row["Revision"].GetInt();
     this.OpenOrder = (int)row["OpenOrder"].GetInt();
     this.VoidOrder = (int)row["VoidOrder"].GetInt();
     this.EntryPerson = (string)row["EntryPerson"].GetString();
     this.OrderDate = (DateTime)row["OrderDate"].GetDate();
     this.TermsCode = (string)row["TermsCode"].GetString();
     this.VendorNum = (int)row["VendorNum"].GetInt();
     this.SupplierName = (string)row["SupplierName"].GetString();
     this.CurrencyCode = (string)row["CurrencyCode"].GetString();
     this.ExchangeRate = (int)row["ExchangeRate"].GetInt();
     this.ApprovedDate = (DateTime)row["ApprovedDate"].GetDate();
     this.ApprovedBy = (string)row["ApprovedBy"].GetString();
     this.Approve = (int)row["Approve"].GetInt();
     this.ApprovalStatus = (string)row["ApprovalStatus"].GetString();
     this.ApprovedAmount = (int)row["ApprovedAmount"].GetInt();
     this.CustId = (string)row["CustId"].GetString();
     this.CustomerName = (string)row["CustomerName"].GetString();
     this.MakerCode = (string)row["MakerCode"].GetString();
     this.MakerName = (string)row["MakerName"].GetString();
     this.MillCode = (string)row["MillCode"].GetString();
     this.MillName = (string)row["MillName"].GetString();
     this.SaleContractNum = (string)row["SaleContractNum"].GetString();
     this.SaleContractDate = (DateTime)row["SaleContractDate"].GetDate();
     this.ImportCode = (string)row["ImportCode"].GetString();
     this.CalculateCode = (string)row["CalculateCode"].GetString();
     this.SectionCode = (string)row["SectionCode"].GetString();
 }
Example #14
1
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public la.Model.friendchange DataRowToModel(DataRow row)
 {
     la.Model.friendchange model=new la.Model.friendchange();
     if (row != null)
     {
         if(row["friendchange_ID"]!=null && row["friendchange_ID"].ToString()!="")
         {
             model.friendchange_ID=int.Parse(row["friendchange_ID"].ToString());
         }
         if(row["friend_id"]!=null && row["friend_id"].ToString()!="")
         {
             model.friend_id=int.Parse(row["friend_id"].ToString());
         }
         if(row["user_telphone"]!=null)
         {
             model.user_telphone=row["user_telphone"].ToString();
         }
         if(row["friendchange_time"]!=null && row["friendchange_time"].ToString()!="")
         {
             model.friendchange_time=DateTime.Parse(row["friendchange_time"].ToString());
         }
         if(row["friendchange_op"]!=null)
         {
             model.friendchange_op=row["friendchange_op"].ToString();
         }
         if(row["friendchange_comment"]!=null)
         {
             model.friendchange_comment=row["friendchange_comment"].ToString();
         }
     }
     return model;
 }
Example #15
1
		private void Init(DataRow dataRow)
		{
			if (_dataRow == null && dataRow != null)
				_createColumns = dataRow.Table.Columns.Count == 0;

			_dataRow = dataRow;
		}
Example #16
1
        private EntityHandler.CustomerMaster ConvertToObject(DataRow row)
        {
            EntityHandler.CustomerMaster obj = new EntityHandler.CustomerMaster();

            try
            {
               // obj.Active = Convert.ToInt32(row["Active"].ToString());
                //obj.Address = row["Address"].ToString();
               // obj.ApprovedBy = Convert.ToInt32(row["ApprovedBy"].ToString());
               // obj.ApprovedDate = Convert.ToDateTime(row["ApprovedDate"].ToString());
               // obj.Area = Convert.ToInt32(row["Area"].ToString());
               // obj.Category = row["Category"].ToString();
              //  obj.Credits_Limits = Convert.ToDecimal(row["Credits_Limits"].ToString());
               // obj.CusFINCode = row["CusFINCode"].ToString();
                obj.Customer_Code = Convert.ToInt32(row["Customer_Code"].ToString());
              //  obj.Customer_Type = row["Customer_Type"].ToString();
                //obj.Date = DateTime.Parse(row["Date"].ToString());
                obj.Name = row["Name"].ToString();
               // obj.Other_Names = row["Other_Names"].ToString();
               // obj.ProductCategory = row["ProductCategory"].ToString();
               // obj.SalesMethod = row["SalesMethod"].ToString();
               // obj.Status = Convert.ToInt32(row["Status"].ToString());
               // obj.UserID = Convert.ToInt32(row["UserID"].ToString());
        


            }
            catch (Exception ex)
            { }
            return obj;
        }
Example #17
1
		protected override RowUpdatedEventArgs CreateRowUpdatedEvent(DataRow dataRow, IDbCommand command,
		                                                             StatementType statementType,
		                                                             DataTableMapping tableMapping)
		{
			NpgsqlEventLog.LogMethodEnter(LogLevel.Debug, CLASSNAME, "CreateRowUpdatedEvent");
			return new NpgsqlRowUpdatedEventArgs(dataRow, command, statementType, tableMapping);
		}
Example #18
1
		public Volunteer(DataRow row)
		{
			this.ID = (int)row["ID"];
			this.FirstName = row["FirstName"] as string;
			this.MiddleNames = row["MiddleName"] as string;
			this.LastName = row["Surname"] as string;
		}
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public int Add(DataRow dr, SqlTransaction trans)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("INSERT INTO hrCompanyShopInfo(");
            strSql.Append("MainID,sShopID,sShopCName,sShopEName,sRemark,sUserID)");
            strSql.Append(" VALUES (");
            strSql.Append("@MainID,@sShopID,@sShopCName,@sShopEName,@sRemark,@sUserID)");
            strSql.Append(";SELECT @@IDENTITY");
            SqlParameter[] parameters = {
                    new SqlParameter("@MainID", SqlDbType.Int,4),
                    new SqlParameter("@sShopID", SqlDbType.VarChar,30),
                    new SqlParameter("@sShopCName", SqlDbType.VarChar,50),
                    new SqlParameter("@sShopEName", SqlDbType.VarChar,50),
                    new SqlParameter("@sRemark", SqlDbType.VarChar,200),
                    new SqlParameter("@sUserID", SqlDbType.VarChar,30)};
            parameters[0].Value = dr["MainID"];
            parameters[1].Value = dr["sShopID"];
            parameters[2].Value = dr["sShopCName"];
            parameters[3].Value = dr["sShopEName"];
            parameters[4].Value = dr["sRemark"];
            parameters[5].Value = dr["sUserID"];

            object obj = DbHelperSQL.GetSingle(strSql.ToString(), trans, parameters);
            if (obj == null)
            {
                return -1;
            }
            else
            {
                return Convert.ToInt32(obj);
            }
        }
Example #20
1
        public string Create( DataRow p)
        {
            string id = Guid.NewGuid().ToString();
            string sql = "";
            sql = " insert into Templet( "
                +" id, "
                + " corp_id,"
                + " name,"
                + " docpath,"
                + " creatorid,"
                + " createtime,"
                + " status"
                + " ) values("
                + " '" + StringHelper.ChkSQL(id) + "',"
                + " '" + StringHelper.ChkSQL(p["corp_id"].ToString()) + "',"
                + " '" + StringHelper.ChkSQL(p["name"].ToString()) + "',"
                + " '" + StringHelper.ChkSQL(p["docpath"].ToString()) + "',"
                + " '" + StringHelper.ChkSQL(p["creatorid"].ToString()) + "',"
                + " getdate() ,"
                + " 1 " //status

                + " ) ";
            commonDAL.ExecSQL( sql);
            return id;
        }
Example #21
1
        private void AddProduto_Click(object sender, EventArgs e)
        {
            try
            {
                linha[3] = TxtBoxQuantUnit.Text;
                linha[4] = TxtBoxPreco.Text;
                linha[5] = Convert.ToString(Convert.ToDouble(TxtBoxDescontoUnit.Text) / (Convert.ToDouble(TxtBoxQuantUnit.Text) * Convert.ToDouble(TxtBoxPreco.Text)) * 100) + " %";
                linha[6] = TxtBoxDescontoUnit.Text;
                linha[7] = (Convert.ToDouble(TxtBoxQuantUnit.Text) * Convert.ToDouble(TxtBoxPreco.Text)) - Convert.ToDouble(TxtBoxDescontoUnit.Text);

                foreach (DataGridViewRow Dr in LsVyPdVenda.Rows)
                {
                    if (Dr.Cells[0].Value.ToString() == TxtBoxProduto.Text.Trim())
                    {
                        MessageBox.Show("O produto " + TxtBoxProduto.Text.Trim() + " já está na grade.", "Item em Duplicidade", MessageBoxButtons.OK, MessageBoxIcon.Information);
                    }
                    else
                    {
                        mDataTable.Rows.Add(linha);
                        LsVyPdVenda.DataSource = mDataTable;
                        linha = mDataTable.NewRow();
                    }
                }

            }
            catch (Exception ex)
            {
                MessageBox.Show("Não foi possível inserir este produto na grade: " + ex.Message.ToString(), "Produto", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #22
1
 /// <summary>
 /// Initializes a new instance of the <see cref="TypedUserFind"/> class.
 /// </summary>
 /// <param name="row">
 /// The row.
 /// </param>
 public TypedUserFind(DataRow row)
 {
     this.UserID = row.Field<int?>("UserID");
     this.BoardID = row.Field<int?>("BoardID");
     this.Name = row.Field<string>("Name");
     this.Password = row.Field<string>("Password");
     this.Email = row.Field<string>("Email");
     this.Joined = row.Field<DateTime?>("Joined");
     this.LastVisit = row.Field<DateTime?>("LastVisit");
     this.IP = row.Field<string>("IP");
     this.NumPosts = row.Field<int?>("NumPosts");
     this.TimeZone = row.Field<int?>("TimeZone");
     this.Avatar = row.Field<string>("Avatar");
     this.Signature = row.Field<string>("Signature");
     this.AvatarImage = row.Field<byte[]>("AvatarImage");
     this.RankID = row.Field<int?>("RankID");
     this.Suspended = row.Field<DateTime?>("Suspended");
     this.LanguageFile = row.Field<string>("LanguageFile");
     this.ThemeFile = row.Field<string>("ThemeFile");
     this.Flags = row.Field<int?>("Flags");
     this.PMNotification = row.Field<bool?>("PMNotification");
     this.Points = row.Field<int?>("Points");
     this.IsApproved = row.Field<bool?>("IsApproved");
     this.IsActiveExcluded = row.Field<bool?>("IsActiveExcluded");
     this.UseMobileTheme = row.Field<bool?>("OverrideDefaultThemes");
     this.AvatarImageType = row.Field<string>("AvatarImageType");
     this.AutoWatchTopics = row.Field<bool?>("AutoWatchTopics");
     this.TextEditor = row.Field<string>("TextEditor");
     this.DisplayName = row.Field<string>("DisplayName");
     this.Culture = row.Field<string>("Culture");
     this.NotificationType = row.Field<int?>("NotificationType");
     this.DailyDigest = row.Field<bool?>("DailyDigest");
     this.IsGuest = row.Field<bool>("IsGuest");
     this.ProviderUserKey = this.IsGuest ? null : ObjectExtensions.ConvertObjectToType(row.Field<string>("ProviderUserKey"), Config.ProviderKeyType);
 }
		public override void LoadData(DataRow CurrentDataRow, IDbConnection conn)
		{
			IsLoaded = false;
			CurrentFRDBase = (GISADataset.FRDBaseRow)CurrentDataRow;
			
			IsLoaded = true;
		}
Example #24
1
        public static void SpellViewInfo(DataRow spellInfo, RichTextBox _rtSpellInfo)
        {
            _rtSpellInfo.SelectionColor = Color.Blue;
            _rtSpellInfo.AppendText(ViewTextInfo(spellInfo));
            _rtSpellInfo.SelectionColor = Color.Black;
            _rtSpellInfo.AppendText(ViewAttribute(spellInfo));

            _rtSpellInfo.AppendText(ViewMask(spellInfo));

            _rtSpellInfo.AppendText(ViewProcFlag(spellInfo));

            _rtSpellInfo.AppendText(ViewFlags(spellInfo));

            _rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc1)));

            _rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc2)));

            _rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFieldBloc3)));

            _rtSpellInfo.AppendText(ViewInfoFromOtherTable(spellInfo));

            _rtSpellInfo.AppendText(ViewReagent(spellInfo));

            _rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFields2), 2));

            _rtSpellInfo.AppendText(ViewSpellFields(spellInfo, typeof(SpellFields3), 3));

            _rtSpellInfo.AppendText(ViewSpellItemInfo(spellInfo));
        }
Example #25
1
		public CUser(String[] ConnectInfo,DataRow dr) : base(ConnectInfo)
		{
			
			//根据数据行设置用户的属性
			SetUserProperty(dr);

		}
Example #26
0
 /// <summary>
 /// 得到一个对象实体
 /// </summary>
 public MxWeiXinPF.Model.wx_diancai_shop_setup DataRowToModel(DataRow row)
 {
     MxWeiXinPF.Model.wx_diancai_shop_setup model=new MxWeiXinPF.Model.wx_diancai_shop_setup();
     if (row != null)
     {
         if(row["id"]!=null && row["id"].ToString()!="")
         {
             model.id=int.Parse(row["id"].ToString());
         }
         if(row["wid"]!=null && row["wid"].ToString()!="")
         {
             model.wid=int.Parse(row["wid"].ToString());
         }
         if(row["unionManage"]!=null)
         {
             model.unionManage=row["unionManage"].ToString();
         }
         if(row["unionTel"]!=null)
         {
             model.unionTel=row["unionTel"].ToString();
         }
         if(row["createDate"]!=null && row["createDate"].ToString()!="")
         {
             model.createDate=DateTime.Parse(row["createDate"].ToString());
         }
         if(row["shopid"]!=null && row["shopid"].ToString()!="")
         {
             model.shopid=int.Parse(row["shopid"].ToString());
         }
     }
     return model;
 }
Example #27
0
        public Box(DataRow dr)
        {
            this.ID = Int32.Parse(dr["Id"].ToString());
            this.DateIn = DateTime.Parse(dr["Date_In"].ToString());
            this.ProductCode = dr["productCode"].ToString();
            this.RecipientName = dr["recipient_name"].ToString();
            this.RecipientLocation = dr["recipient_loc"].ToString();
            this.RecipientAddress = dr["recipient_address"].ToString();
            this.RecipientTelefonNumber = dr["recipient_tel"].ToString();
            this.RecipientCostCenter = dr["recipient_cc"].ToString();
            if (dr["date_out"].ToString().Equals(""))
            {
                this.DateOut = null;
            }
            else
            {
                DateTime d;
                DateTime.TryParse(dr["date_out"].ToString(), out d);
                this.DateOut = d;
            }

            this.DeliveredTo = dr["delivered_to"].ToString();
            this.Sender = dr["sender"].ToString();
            this.Deliverer = dr["deliverer"].ToString();
            this.Ware = dr["wareOrDoc"].ToString().ToLower().Contains("ware");
            this.Document = dr["wareOrDoc"].ToString().ToLower().Contains("document");
            this.Customs = dr["customs"].ToString().Equals("yes");
            this.Comment = dr["comment"].ToString();
            this.Creator = dr["creator"].ToString();
        }
        public DataSet FlipDataSet(DataSet my_DataSet)
        {
            DataSet ds = new DataSet();
            DataTable table = new DataTable();

            foreach (DataTable dt in my_DataSet.Tables)
            {

                for (int i = 0; i <= dt.Rows.Count; i++)
                {
                    table.Columns.Add(Convert.ToString(i));
                }

                for (int k = 0; k < dt.Columns.Count; k++)
                {
                    r = table.NewRow();
                    r[0] = dt.Columns[k].ToString();
                    for (int j = 1; j <= dt.Rows.Count; j++)
                        r[j] = dt.Rows[j - 1][k];
                    table.Rows.Add(r);
                }

                ds.Tables.Add(table);
            }

            return ds;
        }
Example #29
0
		/// <summary>
		/// Cerca la relazione che lega una riga Master con una tabella Detail, o in seconda battuta, un riga Detail con una riga Master
		/// </summary>
		/// <param name="currentRow">Riga corrente Master</param>
		/// <param name="ds">DataSet di riferimento</param>
		/// <param name="tableName">Nome della tabella Detail</param>
		/// <returns>Relazione trovata</returns>
		public static DataRelation FoundRelation(DataRow currentRow, DataSet ds, string tableName)
		{
			DataRelation result = null;
			
			foreach(DataRelation relation in ds.Relations)
			{
				if(relation.ChildTable.TableName == tableName && relation.ParentTable.TableName == currentRow.Table.TableName)
				{
					result = relation;
					break;
				}
			}
			
			if(result == null)
			{
				foreach(DataRelation relation in ds.Relations)
				{
					if(relation.ChildTable.TableName == currentRow.Table.TableName && relation.ParentTable.TableName == tableName)
					{
						result = relation;
						break;
					}
				}
			}

			return result;
		}
		protected override void ParseTableInfo(DataRow rs)
		{
			Catalog = null;
			Schema = Convert.ToString(rs["OWNER"]);
			if (string.IsNullOrEmpty(Schema)) Schema = null;
			Name = Convert.ToString(rs["TABLE_NAME"]);
		}
Example #31
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnIndex">
 ///   The input ordinal specificy which row value to retrieve.
 /// </param>
 /// <param name="version">
 ///   The DataRow version for which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, int columnIndex, DataRowVersion version)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[columnIndex, version]));
 }
Example #32
0
        private int Eval(BinaryNode expr, DataRow row, DataRowVersion version)
        {
            if (expr.op == 0x1a)
            {
                int num4 = this.Eval((BinaryNode)expr.left, row, version);
                if (num4 != 0)
                {
                    return(num4);
                }
                int num3 = this.Eval((BinaryNode)expr.right, row, version);
                if (num3 != 0)
                {
                    return(num3);
                }
                return(0);
            }
            long   num  = 0L;
            object obj3 = expr.left.Eval(row, version);

            if ((expr.op != 13) && (expr.op != 0x27))
            {
                StorageType type;
                object      obj2 = expr.right.Eval(row, version);
                bool        lc   = expr.left is ConstNode;
                bool        rc   = expr.right is ConstNode;
                if ((obj3 == DBNull.Value) || (expr.left.IsSqlColumn && DataStorage.IsObjectSqlNull(obj3)))
                {
                    return(-1);
                }
                if ((obj2 == DBNull.Value) || (expr.right.IsSqlColumn && DataStorage.IsObjectSqlNull(obj2)))
                {
                    return(1);
                }
                StorageType storageType = DataStorage.GetStorageType(obj3.GetType());
                if (StorageType.Char == storageType)
                {
                    if (rc || !expr.right.IsSqlColumn)
                    {
                        obj2 = Convert.ToChar(obj2, this.table.FormatProvider);
                    }
                    else
                    {
                        obj2 = SqlConvert.ChangeType2(obj2, StorageType.Char, typeof(char), this.table.FormatProvider);
                    }
                }
                StorageType right = DataStorage.GetStorageType(obj2.GetType());
                if (expr.left.IsSqlColumn || expr.right.IsSqlColumn)
                {
                    type = expr.ResultSqlType(storageType, right, lc, rc, expr.op);
                }
                else
                {
                    type = expr.ResultType(storageType, right, lc, rc, expr.op);
                }
                if (type == StorageType.Empty)
                {
                    expr.SetTypeMismatchError(expr.op, obj3.GetType(), obj2.GetType());
                }
                num = expr.BinaryCompare(obj3, obj2, type, expr.op);
            }
            switch (expr.op)
            {
            case 7:
                num = (num == 0L) ? ((long)0) : ((num < 0L) ? ((long)(-1)) : ((long)1));
                break;

            case 8:
                num = (num > 0L) ? ((long)0) : ((long)(-1));
                break;

            case 9:
                num = (num < 0L) ? ((long)0) : ((long)1);
                break;

            case 10:
                num = (num >= 0L) ? ((long)0) : ((long)(-1));
                break;

            case 11:
                num = (num <= 0L) ? ((long)0) : ((long)1);
                break;

            case 13:
                num = (obj3 == DBNull.Value) ? ((long)0) : ((long)(-1));
                break;

            case 0x27:
                num = (obj3 != DBNull.Value) ? ((long)0) : ((long)1);
                break;
            }
            return((int)num);
        }
        private void Create_DataTable()
        {
            int iRowCnt = 0;

            // CREATE A DATATABLE AND ADD COLUMNS TO IT.
            mytable.Columns.Add(new System.Data.DataColumn("اسم الصنف", System.Type.GetType("System.String")));

            mytable.Columns.Add(new System.Data.DataColumn("التاريخ",
                                                           System.Type.GetType("System.String")));
            mytable.Columns.Add(new System.Data.DataColumn("العدد", System.Type.GetType("System.String")));
            mytable.Columns.Add(new System.Data.DataColumn("السعر",
                                                           System.Type.GetType("System.String")));
            mytable.Columns.Add(new System.Data.DataColumn("الاجمالى",
                                                           System.Type.GetType("System.String")));
            mytable.Columns.Add(new System.Data.DataColumn("اجمالى الوارد",
                                                           System.Type.GetType("System.String")));
            mytable.Columns.Add(new System.Data.DataColumn("اجمالى المنصرف",
                                                           System.Type.GetType("System.String")));

            mytable.Columns.Add(new System.Data.DataColumn("الرصيد اليومى/الشهرى",
                                                           System.Type.GetType("System.String")));

            // REMOVE PAGING TO HELP EXPORT ENTIRE GRIDVIEW TO EXCEL.
            if (ViewState["click"].ToString() == "1")
            {
                ShowDatabyClient();
            }
            if (ViewState["click"].ToString() == "2")
            {
                ShowDatabyItem();
            }
            if (ViewState["click"].ToString() == "3")
            {
                ShowDatabydate();
            }
            if (ViewState["click"].ToString() == "4")
            {
                ShowDatabymonthDate();
            }

            GridView1.AllowPaging = false;
            GridView1.DataBind();

            foreach (GridViewRow row in GridView1.Rows)
            {
                dr    = mytable.NewRow();
                dr[0] = GridView1.Rows[iRowCnt].Cells[5].Text;
                dr[1] = GridView1.Rows[iRowCnt].Cells[6].Text;
                dr[2] = GridView1.Rows[iRowCnt].Cells[7].Text;
                dr[3] = GridView1.Rows[iRowCnt].Cells[8].Text;
                dr[4] = GridView1.Rows[iRowCnt].Cells[9].Text;
                dr[5] = GridView1.Rows[iRowCnt].Cells[10].Text;
                mytable.Rows.Add(dr);

                iRowCnt += 1;
            }
            dr2    = mytable.NewRow();
            dr2[0] = "";
            dr2[1] = "";
            dr2[2] = "";
            dr2[3] = "";
            dr2[4] = "الاجمالى :" + txtalltotal.Text;
            dr2[5] = "اجمالى الوارد :" + txttawtotal.Text;
            dr2[6] = "اجمالى المنصرف :" + txtrasedd.Text;
            dr2[7] = "الرصيد اليومى/الشهرى :" + txtrasedyomy.Text;
            mytable.Rows.Add(dr2);
        }
Example #34
0
 /// <summary>
 /// Initialize the supplied row from the persistent fields of this object. Note that the ObjectId is initialized
 /// by the PersistenceManager outside of this method.
 /// </summary>
 /// <param name="pc">Persistence capable object</param>
 /// <param name="row">the row that should be filled</param>
 /// <param name="fieldNames">A String array with the field names.</param>
 /// <remarks>The field names and right order of the names in the array will be listed by the enhancer in the file FieldNames.txt.</remarks>
 public static void NDOWrite(object pc, System.Data.DataRow row, string[] fieldNames)
 {
     ((IPersistenceCapable)pc).NDOWrite(row, fieldNames, 0);
 }
 public static System.Data.DataTable CreateDataSetSnapshotTable2(string name = "DataSetSnapshot")
 {
     System.Data.DataTable t = new System.Data.DataTable(name);
     {
         System.Data.DataColumn c = new System.Data.DataColumn( );
         c.DataType   = typeof(System.String);
         c.ColumnName = "DataStore";
         t.Columns.Add(c);
     }
     {
         System.Data.DataColumn c = new System.Data.DataColumn( );
         c.DataType   = typeof(System.Boolean);
         c.ColumnName = "IsActive";
         t.Columns.Add(c);
     }
     {
         System.Data.DataColumn c = new System.Data.DataColumn( );
         c.DataType   = typeof(System.Int16);
         c.ColumnName = "Type";
         t.Columns.Add(c);
     }
     {
         System.Data.DataColumn c = new System.Data.DataColumn( );
         c.DataType   = typeof(System.String); //  typeof( System.DateTime );
         c.ColumnName = "TS";
         t.Columns.Add(c);
     }
     {
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "a";
             r["IsActive"]  = false;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "a";
             r["IsActive"]  = true;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "a";
             r["IsActive"]  = true;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "b";
             r["IsActive"]  = false;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "b";
             r["IsActive"]  = false;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "b";
             r["IsActive"]  = false;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
         {
             System.Data.DataRow r = t.NewRow( );
             r["DataStore"] = "b";
             r["IsActive"]  = true;
             r["Type"]      = 0;
             r["TS"]        = System.DateTime.Now.ToString("yyyyMMdd-HHmmss,fffffff");
             t.Rows.Add(r);
         }
     }
     return(t);
 }
Example #36
0
 /// <summary>
 /// Envia los cambios del tpr_ObjetosCuentasRow a la base de datos realizando una validacin previa. Mtodo Sobrecargado
 /// </summary>
 public static void UpdateWithValidation(System.Data.DataRow row)
 {
     UpdateWithValidation((tpr_ObjetosCuentasDataset.tpr_ObjetosCuentasRow)row);
 }
Example #37
0
 public CTaskList getSingleTask_longplan(System.Data.DataRow projectData)
 {
     if (Organization == "规划室" && userlevel == "6" && projectData["SOLUCHIEF"].ToString() == userName)
     {
         if (projectData["SOLUCOMPDATE_R"].ToString() == "" || projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["FACTCHECKDATE_R"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "#" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "#" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "#")
         {
             this.workItem = "进行中";
             this.workUrl  = "long_plan2.aspx";
         }
         else if (projectData["SOLUSUBMITDATE"].ToString() != "" && projectData["SOLUCHECKDATE"].ToString() != "" && projectData["SOLUADVICEREPLYDATE"].ToString() != "" && projectData["SOLUAPPROVEDATE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "#")
         {
             this.workItem = "结束";
             this.workUrl  = "long_plan2.aspx";
         }
         else
         {
             this.workItem = "等待中";
             this.workUrl  = "long_plan2.aspx";
         }
     }
     else if (Organization == "规划室" && userlevel == "2")
     {
         if (projectData["SOLUSUBMITDATE"].ToString() == "" || projectData["SOLUCHECKDATE"].ToString() == "" || projectData["SOLUADVICEREPLYDATE"].ToString() == "" || projectData["SOLUAPPROVEDATE"].ToString() == "" || projectData["FINALSOLUTIONFILE"].ToString() == "" || projectData["FINALSOLUTIONFILE"].ToString() == "#")
         {
             if (projectData["SOLUCOMPDATE_R"].ToString() == "" || projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["FACTCHECKDATE_R"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "#" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "#" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "#")
             {
                 this.workItem = "等待中";
             }
             else
             {
                 this.workItem = "进行中";
                 this.workUrl  = "long_plan1.aspx";
             }
         }
         else
         {
             this.workItem = "结束";
             this.workUrl  = "long_plan1.aspx";
         }
     }
     else if (Organization == "矿区室" && userlevel == "6" && projectData["SOLUCHIEF"].ToString() == userName)
     {
         if (projectData["SOLUCOMPDATE_R"].ToString() == "" || projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["FACTCHECKDATE_R"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "#" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "#" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "#")
         {
             this.workItem = "进行中";
             this.workUrl  = "long_plan2.aspx";
         }
         else if (projectData["SOLUSUBMITDATE"].ToString() != "" && projectData["SOLUCHECKDATE"].ToString() != "" && projectData["SOLUADVICEREPLYDATE"].ToString() != "" && projectData["SOLUAPPROVEDATE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "#")
         {
             this.workItem = "结束";
             this.workUrl  = "long_plan2.aspx";
         }
         else
         {
             this.workItem = "等待中";
             this.workUrl  = "long_plan2.aspx";
         }
     }
     else if (Organization == "矿区室" && userlevel == "2")
     {
         if (projectData["SOLUSUBMITDATE"].ToString() == "" || projectData["SOLUCHECKDATE"].ToString() == "" || projectData["SOLUADVICEREPLYDATE"].ToString() == "" || projectData["SOLUAPPROVEDATE"].ToString() == "" || projectData["FINALSOLUTIONFILE"].ToString() == "" || projectData["FINALSOLUTIONFILE"].ToString() == "#")
         {
             if (projectData["SOLUCOMPDATE_R"].ToString() == "" || projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["FACTCHECKDATE_R"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "" || projectData["DRAFTSOLUTIONFILE"].ToString() == "#" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == "#" || projectData["FACTAPPRSOLUTIONFILE"].ToString() == "#")
             {
                 this.workItem = "等待中";
             }
             else
             {
                 this.workItem = "进行中";
                 this.workUrl  = "long_plan1.aspx";
             }
         }
         else
         {
             this.workItem = "结束";
             this.workUrl  = "long_plan1.aspx";
         }
     }
     else
     {
         if (projectData["SOLUSUBMITDATE"].ToString() != "" && projectData["SOLUCHECKDATE"].ToString() != "" && projectData["SOLUADVICEREPLYDATE"].ToString() != "" && projectData["SOLUAPPROVEDATE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "#")
         {
             this.workItem = "结束";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     return(this);
 }
Example #38
0
 void ActiveEditor_MouseUp(object sender, MouseEventArgs e)
 {
     System.Data.DataRow row = gvTheLoai.GetDataRow(gvTheLoai.FocusedRowHandle);
     MaTL  = row[0].ToString();
     TenTL = row[1].ToString();
 }
Example #39
0
 public static RateInfoRow Parse(System.Data.DataRow row)
 {
     return(new RateInfoCollection(null).MapRow(row));
 }
Example #40
0
            protected override bool DrawBackground(Graphics g, Rectangle bounds, int rowNum, Brush backBrush, System.Data.DataRow dr)
            {
                Brush background = backBrush;                                       // Use default brush by... hmm... default.

                if ((null != this.AltSolidBrush) || (null != this.AltSolidBrushSpec))
                {                                                                   // If have alternating brush, row is odd and not selected...
                    bool bSel = (((SolidBrush)backBrush).Color != Owner.SelectionBackColor) ? false : true;

                    if (bSel == false)
                    {
                        if (System.DBNull.Value != dr["DIFF"])
                        {
                            NSI.DOCCTRL nState = (NSI.DOCCTRL)dr["DIFF"];
                            if (
                                (nState == NSI.DOCCTRL.OK) ||
                                (((int)dr["MEST"] == (int)dr["MESTZ"]) && ((int)dr["TYPOP"] != AppC.TYPOP_MOVE) && ((int)dr["MEST"] > 0))
                                )
                            {
                                if (this.AltSolidBrush != null)
                                {
                                    background = this.AltSolidBrush;                         // Then use alternating brush.
                                }
                            }
                            else
                            {
                                if (this.AltSolidBrushSpec != null)
                                {
                                    if (((System.DBNull.Value != dr["DIFF"]) &&
                                         ((NSI.DOCCTRL)dr["DIFF"] == NSI.DOCCTRL.WARNS))
                                        )
                                    {
                                        background = this.AltSolidBrushSpec;                         // Then use alternating brush.
                                    }
                                }
                            }
                        }
                        if (System.DBNull.Value != dr["SSCCONLY"])
                        {
                            if ((int)dr["SSCCONLY"] > 0)
                            {// документы для контроля
                                if (this.AltSolidBrushSpec != null)
                                {
                                    background = this.AltSolidBrushSpec;                         // Then use alternating brush.
                                }
                            }
                        }
                    }
                }

                g.FillRectangle(background, bounds);                                // Draw cell background
                return(false);
            }
Example #41
0
            protected override bool DrawBackground(Graphics g, Rectangle bounds, int rowNum,
                                                   Brush backBrush, System.Data.DataRow dr)
            {
                Brush background = backBrush;
                bool  bSelAll    = false,
                      bSel       = (((SolidBrush)backBrush).Color != Owner.SelectionBackColor) ? false : true;

                if (bSel == false)
                {// вообще-то не выделена, но иногда надо выделить
                    switch (this.TableInd)
                    {
                    case NSI.BD_DIND:
                        if (MainF.drEasyEdit == dr)
                        {    // режим быстрого ввода
                            background = this.SelBackBrush;
                            bSelAll    = true;
                        }
                        else
                        {     // возможны и другие цвета
                            if ((null != this.AltSolidBrush) || (null != this.AltSolidBrushSpec))
                            { // If have alternating brush, row is odd and not selected...
                                if (System.DBNull.Value != dr["READYZ"])
                                {
                                    NSI.READINESS nState = (NSI.READINESS)dr["READYZ"];
                                    if (nState == NSI.READINESS.FULL_READY)
                                    {
                                        background = this.AltSolidBrush;                             // Then use alternating brush.
                                    }
                                    else
                                    {
                                        if (this.AltSolidBrushSpec != null)
                                        {
                                            //if ((int)dr["COND"] == (int)NSI.SPECCOND.PARTY_SET)
                                            //    background = this.AltSolidBrushSpec;                         // Then use alternating brush.
                                            if ((((int)dr["COND"] & (int)NSI.SPECCOND.DATE_SET_EXACT) > 0) &&
                                                (this.MappingName == "DVR"))
                                            {
                                                background = this.AltSolidBrushSpec;                             // Then use alternating brush.
                                            }
                                        }
                                    }
                                }
                                if (this.MappingName == "KOLM")
                                {
                                    background = this.AltSolidBrushSpec;                             // Then use alternating brush.
                                }
                            }
                        }
                        break;

                    case NSI.BD_DOUTD:
                        if (null != this.AltSolidBrush)
                        {
                            //if (( (xF.xCDoc.nTypOp == AppC.TYPOP_PRMK)||(xF.xCDoc.nTypOp == AppC.TYPOP_MARK))


                            if ((xF.xCDoc.xDocP.nTypD == AppC.TYPD_OPR) &&
                                (this.MappingName == "SNM"))
                            {
                                if (((int)dr["STATE"] & (int)AppC.OPR_STATE.OPR_TRANSFERED) > 0)
                                {
                                    background = this.AltSolidBrush;
                                }
                            }
                            else
                            {
                                if (dr.GetChildRows(NSI.REL2BRK).Length > 0)
                                {
                                    //if (this.MappingName == "KOLE")
                                    background = this.AltSolidBrush;                    // Для строк с браком
                                }
                            }
                        }
                        if (null != this.AltSolidBrushSpec)
                        {
                            if (((int)dr["NPODDZ"] < 0) &&
                                (this.MappingName == "KOLE"))
                            {
                                background = this.AltSolidBrushSpec;
                            }
                        }
                        break;
                    }



                    //if (this.TableInd == NSI.BD_DIND)
                    //{// колонка для заявок
                    //    if (MainF.drEasyEdit == dr)
                    //    {// режим быстрого ввода
                    //        background = this.SelBackBrush;
                    //        bSelAll = true;
                    //    }
                    //    else
                    //    {// возможны и другие цвета
                    //        if ((null != this.AltSolidBrush) || (null != this.AltSolidBrushSpec))
                    //        {                                                                   // If have alternating brush, row is odd and not selected...
                    //            if ((bSel == false) && (System.DBNull.Value != dr["READYZ"]))
                    //            {
                    //                NSI.READINESS nState = (NSI.READINESS)dr["READYZ"];
                    //                if (nState == NSI.READINESS.FULL_READY)
                    //                    background = this.AltSolidBrush;                         // Then use alternating brush.
                    //                else
                    //                {
                    //                    if (this.AltSolidBrushSpec != null)
                    //                    {
                    //                        if (((System.DBNull.Value != dr["NP"]) && ((int)dr["NP"] > 0)))
                    //                            background = this.AltSolidBrushSpec;                         // Then use alternating brush.
                    //                    }
                    //                }
                    //            }
                    //        }
                    //    }
                    //}
                }

                g.FillRectangle(background, bounds);
                return(bSelAll);
            }
Example #42
0
 /// <summary>
 ///  This method sets a new value for the specified column for the DataRow it’s called on.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow.
 /// </param>
 /// <param name="column">
 ///   The input DataColumn specificy which row value to retrieve.
 /// </param>
 /// <param name="value">
 ///   The new row value for the specified column.
 /// </param>
 public static void SetField <T>(this DataRow row, DataColumn column, T value)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     row[column] = (object)value ?? DBNull.Value;
 }
Example #43
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="columnName">
 ///   The input column name specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, string columnName)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[columnName]));
 }
Example #44
0
 /// <summary>
 /// 获取编号
 /// </summary>
 /// <param name="dt"></param>
 /// <param name="name"></param>
 private string name2ID(DataTable dt, string value, string column)
 {
     dt.PrimaryKey = new System.Data.DataColumn[] { dt.Columns[column] };
     System.Data.DataRow row = dt.Rows.Find(value);
     return(row.ItemArray[1].ToString());
 }
 void IptBaseDb.CreateParam(System.Data.IDbCommand cmd, System.Data.DataTable dtParam, System.Data.DataRow rowValue)
 {
     throw new NotImplementedException();
 }
Example #46
0
        private void gridView1_HiddenEditor(object sender, EventArgs e)
        {
            try
            {
                int slno = gridView1.GetFocusedDataSourceRowIndex();
                Test.Purchase.database.PurchaseOrder po = new Purchase.database.PurchaseOrder();
                System.Data.DataRow row = gridView1.GetDataRow(gridView1.FocusedRowHandle);
                row["slno"] = (slno + 1) + "";

                if (gridView1.FocusedColumn.FieldName.Equals("itemCode"))
                {
                    String itemcode = row["itemCode"].ToString();
                    if (itemcode != "")
                    {
                        po.FnConn();
                        DataTable dt = po.FillData("itemdetails", itemcode);
                        if (dt.Rows.Count > 0)
                        {
                            row["description"] = dt.Rows[0]["itemName"].ToString();
                            row["brand"]       = dt.Rows[0]["brandName"].ToString();
                            row["quantity"]    = "1";
                        }
                    }
                }

                if (gridView1.FocusedColumn.FieldName.Equals("quantity"))
                {
                    double quantity = 0, unitprice = 0;
                    try
                    {
                        quantity = Convert.ToDouble(row["quantity"] + "");
                    }
                    catch (Exception ex1)
                    {
                        row["quantity"] = "1";
                    }

                    try
                    {
                        unitprice = Convert.ToDouble(row["unitprice"] + "");
                    }
                    catch (Exception invalidstring)
                    {
                        row["unitprice"] = "";
                    }
                    double total = quantity * unitprice;
                    row["amount"] = total + "";
                    row["total"]  = total + "";


                    int index = gridView1.GetFocusedDataSourceRowIndex();
                    gridView1.RefreshRow(index);
                    calculateTotal();

                    gridView1.FocusedColumn    = gridView1.GetVisibleColumn(6);
                    gridView1.FocusedRowHandle = index;
                    gridView1.ShowEditor();
                }

                if (gridView1.FocusedColumn.FieldName.Equals("unitprice"))
                {
                    double quantity = 0, unitprice = 0;
                    try
                    {
                        quantity = Convert.ToDouble(row["quantity"] + "");
                    }
                    catch (Exception ex1)
                    {
                        row["quantity"] = "1";
                    }

                    try
                    {
                        unitprice = Convert.ToDouble(row["unitprice"] + "");
                    }
                    catch (Exception invalidstring)
                    {
                        row["unitprice"] = "";
                    }
                    double total = quantity * unitprice;
                    row["amount"] = total + "";
                    row["total"]  = total + "";

                    int index = gridView1.GetFocusedDataSourceRowIndex();
                    gridView1.RefreshRow(index);
                    calculateTotal();

                    gridView1.FocusedColumn    = gridView1.GetVisibleColumn(6);
                    gridView1.FocusedRowHandle = index;
                    gridView1.ShowEditor();
                }
            }


            catch (Exception)
            {
            }
        }
Example #47
0
 protected override void FillProps(System.Data.DataRow in_row)
 {
     base.FillProps(in_row);
     CellsXAsString = (string)in_row["cells_x"];
     CellsYAsString = (string)in_row["cells_y"];
 }
Example #48
0
 /// <summary>
 /// Envia los cambios del tpu_ComprobantesPagoRow a la base de datos realizando una validacin previa. Mtodo Sobrecargado
 /// </summary>
 public static void UpdateWithValidation(System.Data.DataRow row)
 {
     UpdateWithValidation((tpu_ComprobantesPagoDataset.tpu_ComprobantesPagoRow)row);
 }
 /// <summary>
 /// Envia los cambios del tsa_ComprobantesMovimientosDeStockRow a la base de datos realizando una validacin previa. Mtodo Sobrecargado
 /// </summary>
 public static void UpdateWithValidation(System.Data.DataRow row)
 {
     UpdateWithValidation((tsa_ComprobantesMovimientosDeStockDataset.tsa_ComprobantesMovimientosDeStockRow)row);
 }
Example #50
0
 /// <summary>
 /// Envia los cambios del st_TareaRow a la base de datos realizando una validacin previa. Mtodo Sobrecargado
 /// </summary>
 public static void UpdateWithValidation(System.Data.DataRow row)
 {
     UpdateWithValidation((st_TareaDataset.st_TareaRow)row);
 }
        public static void LoadDataStoreSnapshotFilesTable(System.Data.DataSet ds)
        {
            DataPhilosophiaeSection dps = System.Configuration.ConfigurationManager.GetSection("DataPhilosophiaeSection") as DataPhilosophiaeSection;

            System.Configuration.ConnectionStringSettingsCollection css = System.Configuration.ConfigurationManager.ConnectionStrings;
            if (dps == null)
            {
                throw new System.Exception("[DataPhilosophiaeSection] section missing in app.config!!!");
            }
            if (css == null)
            {
                throw new System.Exception("[connectionStrings] section missing in app.config!!!");
            }
            int       iii      = 0;
            DataTable dscTbl   = ds.Tables[DataStoreConfig_TblName];
            DataTable dsssfTbl = ds.Tables[DataStoreSnapshotFile_TblName];

            foreach (DataStoreElement dse in dps.DataStores)
            {
                System.Configuration.ConnectionStringSettings cs = css[dse.ConnectionStringName];
                {
                    System.Data.DataRow r = dscTbl.NewRow( );
                    //r[ "ID" ] = i++;
                    r["Name"] = dse.Name;
                    r["ConnectionStringName"]    = dse.ConnectionStringName;
                    r["LoadDefaultDatabaseOnly"] = dse.LoadDefaultDatabaseOnly == 1 ? true : false;
                    r["LoadSystemObjects"]       = dse.LoadSystemObjects == 1 ? true : false;
                    r["WithFields"]   = dse.WithFields == 1 ? true : false;
                    r["StagePathDir"] = string.IsNullOrWhiteSpace(dse.PathDir)
               ? System.IO.Path.Combine(dps.Stage.PathDir, dse.Name)
               : dse.PathDir;
                    r["ConnectionString"] = cs != null ? cs.ConnectionString : null;
                    r["ProviderName"]     = cs != null ? cs.ProviderName : null;
                    //
                    System.IO.DirectoryInfo di = new System.IO.DirectoryInfo((string)r["StagePathDir"]);
                    r[IsValidStagePathDir_ColName] = di.Exists;
                    r["IsValidProviderName"]       = !string.IsNullOrWhiteSpace(cs != null ? cs.ProviderName : null);
                    //
                    dscTbl.Rows.Add(r);
                    //
                    if (di.Exists)
                    {
                        System.IO.FileInfo[] files = GetFiles(di);
                        int ii = 0;
                        for (int i = 0; i < files.Length; i++)
                        {
                            System.Data.DataRow rr = dsssfTbl.NewRow( );
                            rr["Name"]             = dse.Name;
                            rr["IsActive"]         = false;
                            rr["LastWriteTimeUtc"] = files[i].LastWriteTimeUtc;
                            if (files[i].LastWriteTimeUtc > files[ii].LastWriteTimeUtc)
                            {
                                ii = i;
                            }
                            rr["SnapshotFile"] = files[i];
                            dsssfTbl.Rows.Add(rr);
                        }
                        if (files.Length > 0)
                        {
                            dsssfTbl.Rows[iii + ii]["IsActive"] = true;
                        }
                        iii += files.Length;
                    }
                }
            }
        }
Example #52
0
 /// <summary>
 /// Envia los cambios del tsh_AgrupProductosRow a la base de datos realizando una validacin previa. Mtodo Sobrecargado
 /// </summary>
 public static bool UpdateWithValidation(System.Data.DataRow row)
 {
     return(UpdateWithValidation((tsh_AgrupProductosDataset.tsh_AgrupProductosRow)row));
 }
Example #53
0
 public static CustomerSupportGroupRow Parse(System.Data.DataRow row)
 {
     return(new CustomerSupportGroupCollection(null).MapRow(row));
 }
Example #54
0
        private void btnedtSou_TextChanged(object sender, EventArgs e)
        {
            if (btnedtSou.Text == "")
            {
                return;
            }
            string[] sPosPairs = System.IO.File.ReadAllLines(btnedtSou.Text);
            if (sPosPairs == null || sPosPairs.Length == 0)
            {
                MessageBox.Show("请选择正确的文件");
                return;
            }
            int startIndex = 0;

            if (chkBegin2.Checked)
            {
                startIndex = 1;
            }
            if (sPosPairs.Length <= startIndex)
            {
                MessageBox.Show("请选择正确的文件");
                return;
            }
            int       ixh = GetMaxXH() + 1;
            DataTable dt = this.treePosPair.DataSource as DataTable;
            double    soux, souy, souz, tarx, tary, tarz;
            int       errCount = 0;

            for (int i = startIndex; i < sPosPairs.Length; i++)
            {
                souz = 0;
                tarz = 0;
                try
                {
                    string[] parts = sPosPairs[i].Split(',');
                    soux = Convert.ToDouble(parts[1]);
                    souy = Convert.ToDouble(parts[2]);
                    if (chkHavZ.Checked)
                    {
                        souz = Convert.ToDouble(parts[3]);
                        tarx = Convert.ToDouble(parts[4]);
                        tary = Convert.ToDouble(parts[5]);
                        tarz = Convert.ToDouble(parts[6]);
                    }
                    else
                    {
                        tarx = Convert.ToDouble(parts[3]);
                        tary = Convert.ToDouble(parts[4]);
                    }
                }
                catch
                {
                    errCount++;
                    continue;
                }
                System.Data.DataRow row = dt.NewRow();
                row.SetField("I_XH", ixh++);
                row.SetField("WKID", this._wkid);
                row.SetField("SOU_X", soux);
                row.SetField("SOU_Y", souy);
                row.SetField("SOU_Z", souz);
                row.SetField("TAR_X", tarx);
                row.SetField("TAR_Y", tary);
                row.SetField("TAR_Z", tarz);
                dt.Rows.Add(row);
            }
            if (errCount == 0 || DialogResult.OK == MessageBox.Show(string.Format("总计{0}条记录,其中无效记录{1}条,\r\n是否继续添加?点击“OK”,则继续添加,否则不添加。", sPosPairs.Length - startIndex, errCount), "提示", MessageBoxButtons.OKCancel))
            {
                this.treePosPair.DataSource = dt;
                this.treePosPair.RefreshDataSource();
            }
            else
            {
                this.btnedtSou.Text = "";
            }
        }
Example #55
0
            public int Compare(System.Data.DataRow x, System.Data.DataRow y)
            {
                int compareResult = 0;

                foreach (int key in SortColumns.Keys)
                {
                    string value1 = string.Empty;
                    string value2 = string.Empty;
                    //int compareResult;
                    // Check for nulls
                    if (x.ItemArray[key] == DBNull.Value)
                    {
                        value1 = "0";
                    }
                    else
                    {
                        value1 = x.ItemArray[key].ToString().TrimEnd('+');
                        if (value1.Contains('.'))
                        {
                            value1 = value1.TrimStart('.');
                        }
                        if (value1.Contains('床'))
                        {
                            value1.Replace("床", "");
                        }
                        value1 = value1.TrimStart('+');
                    }
                    if (y.ItemArray[key] == DBNull.Value)
                    {
                        value2 = "0";
                    }
                    else
                    {
                        value2 = y.ItemArray[key].ToString().TrimEnd('+');
                        if (value2.Contains('.'))
                        {
                            value2 = value2.TrimStart('.');
                        }
                        if (value2.Contains('床'))
                        {
                            value2.Replace("床", "");
                        }
                        value2 = value2.TrimStart('+');
                    }

                    if (IsNumeric(value1) && IsNumeric(value2))
                    {
                        if (int.Parse(value1) > int.Parse(value2))
                        {
                            compareResult = 1;
                        }
                        else if (int.Parse(value1) < int.Parse(value2))
                        {
                            compareResult = -1;
                        }
                        else
                        {
                            compareResult = 0;
                        }
                    }
                    else if (IsNumeric(value1))
                    {
                        compareResult = -1;
                    }
                    else if (IsNumeric(value2))
                    {
                        compareResult = 1;
                    }
                    else
                    {
                        compareResult = System.String.Compare(value1, value2);
                    }
                }
                return(compareResult * sortOrderModifier);
            }
Example #56
0
        internal static DataTable GetSchemaTableFromDataTable(DataTable table)
        {
            if (table == null)
            {
                throw ExceptionBuilder.ArgumentNull(nameof(DataTable));
            }

            DataTable tempSchemaTable = new DataTable("SchemaTable");

            tempSchemaTable.Locale = System.Globalization.CultureInfo.InvariantCulture;

            DataColumn ColumnName          = new DataColumn(SchemaTableColumn.ColumnName, typeof(string));
            DataColumn ColumnOrdinal       = new DataColumn(SchemaTableColumn.ColumnOrdinal, typeof(int));
            DataColumn ColumnSize          = new DataColumn(SchemaTableColumn.ColumnSize, typeof(int));
            DataColumn NumericPrecision    = new DataColumn(SchemaTableColumn.NumericPrecision, typeof(short));
            DataColumn NumericScale        = new DataColumn(SchemaTableColumn.NumericScale, typeof(short));
            DataColumn DataType            = new DataColumn(SchemaTableColumn.DataType, typeof(Type));
            DataColumn ProviderType        = new DataColumn(SchemaTableColumn.ProviderType, typeof(int));
            DataColumn IsLong              = new DataColumn(SchemaTableColumn.IsLong, typeof(bool));
            DataColumn AllowDBNull         = new DataColumn(SchemaTableColumn.AllowDBNull, typeof(bool));
            DataColumn IsReadOnly          = new DataColumn(SchemaTableOptionalColumn.IsReadOnly, typeof(bool));
            DataColumn IsRowVersion        = new DataColumn(SchemaTableOptionalColumn.IsRowVersion, typeof(bool));
            DataColumn IsUnique            = new DataColumn(SchemaTableColumn.IsUnique, typeof(bool));
            DataColumn IsKeyColumn         = new DataColumn(SchemaTableColumn.IsKey, typeof(bool));
            DataColumn IsAutoIncrement     = new DataColumn(SchemaTableOptionalColumn.IsAutoIncrement, typeof(bool));
            DataColumn BaseSchemaName      = new DataColumn(SchemaTableColumn.BaseSchemaName, typeof(string));
            DataColumn BaseCatalogName     = new DataColumn(SchemaTableOptionalColumn.BaseCatalogName, typeof(string));
            DataColumn BaseTableName       = new DataColumn(SchemaTableColumn.BaseTableName, typeof(string));
            DataColumn BaseColumnName      = new DataColumn(SchemaTableColumn.BaseColumnName, typeof(string));
            DataColumn AutoIncrementSeed   = new DataColumn(SchemaTableOptionalColumn.AutoIncrementSeed, typeof(long));
            DataColumn AutoIncrementStep   = new DataColumn(SchemaTableOptionalColumn.AutoIncrementStep, typeof(long));
            DataColumn DefaultValue        = new DataColumn(SchemaTableOptionalColumn.DefaultValue, typeof(object));
            DataColumn Expression          = new DataColumn(SchemaTableOptionalColumn.Expression, typeof(string));
            DataColumn ColumnMapping       = new DataColumn(SchemaTableOptionalColumn.ColumnMapping, typeof(MappingType));
            DataColumn BaseTableNamespace  = new DataColumn(SchemaTableOptionalColumn.BaseTableNamespace, typeof(string));
            DataColumn BaseColumnNamespace = new DataColumn(SchemaTableOptionalColumn.BaseColumnNamespace, typeof(string));

            ColumnSize.DefaultValue = -1;

            if (table.DataSet != null)
            {
                BaseCatalogName.DefaultValue = table.DataSet.DataSetName;
            }

            BaseTableName.DefaultValue      = table.TableName;
            BaseTableNamespace.DefaultValue = table.Namespace;
            IsRowVersion.DefaultValue       = false;
            IsLong.DefaultValue             = false;
            IsReadOnly.DefaultValue         = false;
            IsKeyColumn.DefaultValue        = false;
            IsAutoIncrement.DefaultValue    = false;
            AutoIncrementSeed.DefaultValue  = 0;
            AutoIncrementStep.DefaultValue  = 1;

            tempSchemaTable.Columns.Add(ColumnName);
            tempSchemaTable.Columns.Add(ColumnOrdinal);
            tempSchemaTable.Columns.Add(ColumnSize);
            tempSchemaTable.Columns.Add(NumericPrecision);
            tempSchemaTable.Columns.Add(NumericScale);
            tempSchemaTable.Columns.Add(DataType);
            tempSchemaTable.Columns.Add(ProviderType);
            tempSchemaTable.Columns.Add(IsLong);
            tempSchemaTable.Columns.Add(AllowDBNull);
            tempSchemaTable.Columns.Add(IsReadOnly);
            tempSchemaTable.Columns.Add(IsRowVersion);
            tempSchemaTable.Columns.Add(IsUnique);
            tempSchemaTable.Columns.Add(IsKeyColumn);
            tempSchemaTable.Columns.Add(IsAutoIncrement);
            tempSchemaTable.Columns.Add(BaseCatalogName);
            tempSchemaTable.Columns.Add(BaseSchemaName);

            // specific to datatablereader
            tempSchemaTable.Columns.Add(BaseTableName);
            tempSchemaTable.Columns.Add(BaseColumnName);
            tempSchemaTable.Columns.Add(AutoIncrementSeed);
            tempSchemaTable.Columns.Add(AutoIncrementStep);
            tempSchemaTable.Columns.Add(DefaultValue);
            tempSchemaTable.Columns.Add(Expression);
            tempSchemaTable.Columns.Add(ColumnMapping);
            tempSchemaTable.Columns.Add(BaseTableNamespace);
            tempSchemaTable.Columns.Add(BaseColumnNamespace);

            foreach (DataColumn dc in table.Columns)
            {
                DataRow dr = tempSchemaTable.NewRow();

                dr[ColumnName]    = dc.ColumnName;
                dr[ColumnOrdinal] = dc.Ordinal;
                dr[DataType]      = dc.DataType;

                if (dc.DataType == typeof(string))
                {
                    dr[ColumnSize] = dc.MaxLength;
                }

                dr[AllowDBNull] = dc.AllowDBNull;
                dr[IsReadOnly]  = dc.ReadOnly;
                dr[IsUnique]    = dc.Unique;

                if (dc.AutoIncrement)
                {
                    dr[IsAutoIncrement]   = true;
                    dr[AutoIncrementSeed] = dc.AutoIncrementSeed;
                    dr[AutoIncrementStep] = dc.AutoIncrementStep;
                }

                if (dc.DefaultValue != DBNull.Value)
                {
                    dr[DefaultValue] = dc.DefaultValue;
                }

                if (dc.Expression.Length != 0)
                {
                    bool         hasExternalDependency = false;
                    DataColumn[] dependency            = dc.DataExpression.GetDependency();
                    for (int j = 0; j < dependency.Length; j++)
                    {
                        if (dependency[j].Table != table)
                        {
                            hasExternalDependency = true;
                            break;
                        }
                    }
                    if (!hasExternalDependency)
                    {
                        dr[Expression] = dc.Expression;
                    }
                }

                dr[ColumnMapping]       = dc.ColumnMapping;
                dr[BaseColumnName]      = dc.ColumnName;
                dr[BaseColumnNamespace] = dc.Namespace;

                tempSchemaTable.Rows.Add(dr);
            }

            foreach (DataColumn key in table.PrimaryKey)
            {
                tempSchemaTable.Rows[key.Ordinal][IsKeyColumn] = true;
            }

            tempSchemaTable.AcceptChanges();

            return(tempSchemaTable);
        }
Example #57
0
 public CTaskList getSingleTask(System.Data.DataRow projectData)
 {
     if (projectData["BLUEGRAPHARRIVALDATE"].ToString() != "" && projectData["SOLUAPPROVEDATE"].ToString() != "" && projectData["PNUMBER"].ToString() != "" && projectData["PLANINVESMENT"].ToString() != "")
     {
         this.workItem = "结束";
     }
     else if (userlevel == "2" && Organization == "规划室") //规划室主任
     {
         if (projectData["PLANFLAG"].ToString() != "2")
         {
             if (projectData["SOLUCOMPDATE_P"].ToString() != "" && projectData["SOLUCOMPDATE_R"].ToString() == "")//如果方案计划完成时间不为空,方案实际完成时间为空,则应该编写方案
             {
                 this.workItem = "等待中";
                 this.workUrl  = "init_planRun_dtz.aspx";
             }
             else if (projectData["INSTAPPRSOLUTIONFILE"].ToString() != "" && (projectData["DESICONDITIONTABLE"].ToString() == "" || projectData["SOLUAPPROVEDATE"].ToString() == "" || projectData["PNUMBER"].ToString() == "" || projectData["PLANINVESMENT"].ToString() == ""))
             {
                 this.workItem = "上报方案";
                 this.workUrl  = "planrun_part.aspx";
             }
             else if (projectData["PLANFLAG"].ToString() == "1" && (projectData["SOLUAPPROVEDATE"].ToString() == "" || projectData["PNUMBER"].ToString() == "" || projectData["PLANINVESMENT"].ToString() == ""))
             {
                 this.workItem = "上报方案";
                 this.workUrl  = "write_planrun_free.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "2" && Organization == "矿区室") //矿区室主任
     {
         //矿区室进行规划
         if (projectData["PLANFLAG"].ToString() == "2")
         {
             if (projectData["SOLUCOMPDATE_P"].ToString() != "" && projectData["SOLUCOMPDATE_R"].ToString() == "")//如果方案计划完成时间不为空,方案实际完成时间为空,则应该编写方案
             {
                 this.workItem = "等待中";
                 this.workUrl  = "init_planRun_dtz.aspx";
             }
             else if (projectData["INSTAPPRSOLUTIONFILE"].ToString() != "" && (projectData["DESICONDITIONTABLE"].ToString() == "" || projectData["SOLUAPPROVEDATE"].ToString() == "" || projectData["PNUMBER"].ToString() == "" || projectData["PLANINVESMENT"].ToString() == ""))
             {
                 this.workItem = "上报方案";
                 this.workUrl  = "planrun_part.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         //矿区室进行设计
         else if (projectData["PLANFLAG_DESIGN"].ToString() == "1")
         {
             if (projectData["DESICONDITIONTABLE"].ToString() != "" && projectData["PNUMBER"].ToString() != "" && projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["DESICHIEF"].ToString() == "" && projectData["MAJORPROOFREADER"].ToString() == "")
             {
                 this.workItem = "指定负责人";
                 this.workUrl  = "DesignatedDesignPerson.aspx";
             }
             else if ((projectData["DESICHIEF"].ToString() != "" || projectData["MAJORPROOFREADER"].ToString() != "") && projectData["MAJORDELEGATEDATE_R"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "DesignatedDesignPerson.aspx";
             }
             else if (projectData["INITIALDESISUBMITDATE_R"].ToString() != "" && (projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() == "" || projectData["DESIAPPRFILE"].ToString() == ""))
             {
                 this.workItem = "批复下达";
                 this.workUrl  = "DesiApprovalArrival.aspx";
             }
             else if (projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() != "" && projectData["DESIAPPRFILE"].ToString() != "" && projectData["BUDGETADJUSTDATE_P"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "DesiApprovalArrival.aspx";
             }
             else if (projectData["BUDGETADJUSTDATE_R"].ToString() != "" && (projectData["PLANARRIVALFILENUMBER"].ToString() == "" || projectData["PLANARRIVALFILE"].ToString() == ""))
             {
                 this.workItem = "计划下达";
                 this.workUrl  = "PlanArrival.aspx";
             }
             else if (projectData["PLANARRIVALFILENUMBER"].ToString() != "" && projectData["PLANARRIVALFILE"].ToString() != "" && projectData["WHITEGRAPHCHECKDATE_R"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "PlanArrival.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userName == projectData["SOLUCHIEF"].ToString())                                                 //方案负责人
     {
         if (projectData["SOLUCOMPDATE_P"].ToString() != "" && projectData["SOLUCOMPDATE_R"].ToString() == "") //如果方案计划完成时间不为空,方案实际完成时间为空,则应该编写方案
         {
             this.workItem = "编写方案";
             this.workUrl  = "writePlan.aspx";
         }
         else if (projectData["CHECKSTATE"].ToString() == "0")
         {
             this.workItem = "重写方案";
             this.workUrl  = "planReturn.aspx";
         }
         else if (projectData["CHECKSTATE"].ToString() == "")//所审还没进行之前,可以修改之前上传的表单
         {
             this.workItem = "等待中";
             this.workUrl  = "writePlan.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "4" && Organization == "规划室")   //如果所审计划时间确定、方案实际完成时间确定且实际所审时间还未确定,则应该进行实际所审。
     {
         if (projectData["PLANFLAG"].ToString() != "2")
         {
             if (projectData["CHECKSTATE"].ToString() == "" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && (projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == ""))
             {
                 this.workItem = "审查方案";
                 this.workUrl  = "CheckPlanRun_dtz.aspx";
             }
             else if (projectData["CHECKSTATE"].ToString() == "0" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && projectData["INSTAPPRSOLUTIONFILE"].ToString() == "")
             {
                 this.workItem = "退回方案";
             }
             else if (projectData["CHECKSTATE"].ToString() == "1" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && projectData["INSTAPPRSOLUTIONFILE"].ToString() == "")
             {
                 this.workItem = "重新审查方案";
                 this.workUrl  = "CheckPlanRun_dtz.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "4" && Organization == "矿区室")   //如果所审计划时间确定、方案实际完成时间确定且实际所审时间还未确定,则应该进行实际所审。
     {
         if (projectData["PLANFLAG"].ToString() == "2")
         {
             if (projectData["CHECKSTATE"].ToString() == "" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && (projectData["INSTCHECKDATE_R"].ToString() == "" || projectData["INSTAPPRSOLUTIONFILE"].ToString() == ""))
             {
                 this.workItem = "审查方案";
                 this.workUrl  = "CheckPlanRun_dtz.aspx";
             }
             else if (projectData["CHECKSTATE"].ToString() == "0" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && projectData["INSTAPPRSOLUTIONFILE"].ToString() == "")
             {
                 this.workItem = "退回方案";
             }
             else if (projectData["CHECKSTATE"].ToString() == "1" && projectData["SOLUCOMPDATE_R"].ToString() != "" && projectData["INSTCHECKDATE_P"].ToString() != "" && projectData["INSTAPPRSOLUTIONFILE"].ToString() == "")
             {
                 this.workItem = "重新审查方案";
                 this.workUrl  = "CheckPlanRun_dtz.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "2" && Organization == "设计室")   //设计室主任
     {
         if (projectData["PLANFLAG_DESIGN"].ToString() == "0")
         {
             //if (projectData["PLANFLAG"].ToString() == "1" && (projectData["SOLUCOMPDATE_P"].ToString() == "" || projectData["DESICHIEF"].ToString() == ""))//如果方案计划完成时间不为空,方案实际完成时间为空,则应该编写方案
             //{
             //    this.workItem = "发起流程";
             //    this.workUrl = "init_planRun_free.aspx";
             //}
             //if (projectData["PLANFLAG"].ToString() == "1" && projectData["WORKLOADSUBMITDATE_P"].ToString() != "" && projectData["DESICHIEF"].ToString() != "" && projectData["SOLUCOMPDATE_R"].ToString() == "")//如果方案计划完成时间不为空,方案实际完成时间为空,则应该编写方案
             //{
             //    this.workItem = "等待中";
             //    this.workUrl = "init_planRun_free.aspx";
             //}
             if ((projectData["PLANFLAG"].ToString() == "0" || projectData["PLANFLAG"].ToString() == "2") && projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["PNUMBER"].ToString() != "" && projectData["DESICONDITIONTABLE"].ToString() != "" && (projectData["DESICHIEF"].ToString() == "" || projectData["MAJORPROOFREADER"].ToString() == ""))
             {
                 this.workItem = "指定负责人";
                 this.workUrl  = "DesignatedDesignPerson.aspx";
             }
             else if ((projectData["PLANFLAG"].ToString() == "0" || projectData["PLANFLAG"].ToString() == "2") && projectData["DESICHIEF"].ToString() != "" && projectData["MAJORPROOFREADER"].ToString() != "" && projectData["WORKLOADSUBMITDATE_R"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "DesignatedDesignPerson.aspx";
             }
             else if (projectData["INITIALDESISUBMITDATE_R"].ToString() != "" && (projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() == "" || projectData["DESIAPPRFILE"].ToString() == ""))
             {
                 this.workItem = "批复下达";
                 this.workUrl  = "DesiApprovalArrival.aspx";
             }
             else if (projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() != "" && projectData["DESIAPPRFILE"].ToString() != "" && projectData["BUDGETADJUSTDATE_P"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "DesiApprovalArrival.aspx";
             }
             else if (projectData["BUDGETADJUSTDATE_R"].ToString() != "" && (projectData["PLANARRIVALFILENUMBER"].ToString() == "" || projectData["PLANARRIVALFILE"].ToString() == ""))
             {
                 this.workItem = "计划下达";
                 this.workUrl  = "PlanArrival.aspx";
             }
             else if (projectData["PLANARRIVALFILENUMBER"].ToString() != "" && projectData["PLANARRIVALFILE"].ToString() != "" && projectData["WHITEGRAPHCHECKDATE_R"].ToString() == "")
             {
                 this.workItem = "等待中";
                 this.workUrl  = "PlanArrival.aspx";
             }
             else
             {
                 this.workItem = "等待中";
             }
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "2" && Organization == "综合室")  //综合室主任
     {
         if (projectData["PLANFLAG"].ToString() == "1" && projectData["BUDGETCHIEF"].ToString() == "")
         {
             this.workItem = "指定概算负责人";
             this.workUrl  = "DesignatedBudgetPerson.aspx";
         }
         else if (projectData["FINALSOLUTIONFILE"].ToString() != "" && projectData["PNUMBER"].ToString() != "" && projectData["DESICONDITIONTABLE"].ToString() != "" && projectData["BUDGETCHIEF"].ToString() == "")
         {
             this.workItem = "指定概算负责人";
             this.workUrl  = "DesignatedBudgetPerson.aspx";
         }
         else if (projectData["BUDGETCHIEF"].ToString() != "" && projectData["BUDGETCOMPDATE_R"].ToString() == "")
         {
             this.workItem = "等待中";
             this.workUrl  = "DesignatedBudgetPerson.aspx";
         }
         else if (projectData["BUDGETCOMPDATE_R"].ToString() != "" && projectData["INITIALDESISUBMITDATE_R"].ToString() == "")
         {
             this.workItem = "初设上报";
             this.workUrl  = "InitialDesiSubmit.aspx";
         }
         else if (projectData["INITIALDESISUBMITDATE_R"].ToString() != "" && projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() == "")
         {
             this.workItem = "等待中";
             this.workUrl  = "InitialDesiSubmit.aspx";
         }
         else if (projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() != "" && projectData["DESIAPPRFILE"].ToString() != "" && projectData["BUDGETADJUSTDATE_P"].ToString() == "")
         {
             this.workItem = "概算计划调整时间";
             this.workUrl  = "BudgetAjustDate_P.aspx";
         }
         else if (projectData["BUDGETADJUSTDATE_P"].ToString() != "" && projectData["BUDGETADJUSTDATE_R"].ToString() == "")
         {
             this.workItem = "概算调整";
             this.workUrl  = "BudgetAdjust.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userName == projectData["DESICHIEF"].ToString())//设计负责人
     {
         //if(projectData["WORKLOADSUBMITDATE_R"].ToString() == ""&& projectData["PLANFLAG"].ToString() == "1")
         //{
         //    this.workItem = "初设工程量提交";
         //    this.workUrl = "MajorDelegateData_free.aspx";
         //}
         if (projectData["DESICHIEF"].ToString() != "" && projectData["WORKLOADSUBMITDATE_R"].ToString() == "")
         {
             this.workItem = "委托资料和工程量";
             this.workUrl  = "MainOfCommissionAndWorkload.aspx";
         }
         else if (projectData["PLANARRIVALFILENUMBER"].ToString() != "" && (projectData["WHITEGRAPHCHECKDATE_R"].ToString() == "" || projectData["BLUEGRAPHDOCUMENT_R"].ToString() == "" || projectData["SECONDCOMMISSIONDATE"].ToString() == ""))
         {
             this.workItem = "施工白图校审和蓝图";
             this.workUrl  = "MainOfWhiteGraphAndBlueGraph.aspx";
         }
         else if (projectData["BLUEGRAPHDOCUMENT_R"].ToString() != "" && projectData["WHITEGRAPHCHECKDATE_R"].ToString() != "" && projectData["SECONDCOMMISSIONDATE"].ToString() != "" && projectData["BLUEGRAPHARRIVALDATE"].ToString() == "")
         {
             this.workItem = "等待中";
             this.workUrl  = "MainOfWhiteGraphAndBlueGraph.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userName == projectData["BUDGETCHIEF"].ToString()) //综合室概算负责人
     {
         if (projectData["BUDGETCOMPDATE_R"].ToString() == "")
         {
             this.workItem = "编写概算文档";
             this.workUrl  = "DraftBudgetFile.aspx";
         }
         else if (projectData["BUDGETCOMPDATE_R"].ToString() != "" && projectData["INITIALDESISUBMITDATE_R"].ToString() == "")
         {
             this.workItem = "等待中";
             this.workUrl  = "DraftBudgetFile.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "6" && (Organization == "设计室" || Organization == "矿区室"))//设计室各专业
     {
         if (JudgeName(userName, projectData["PNAME"].ToString(), projectData["PNUMBER"].ToString()) == 1 && projectData["WORKLOADSUBMITDATE_R"].ToString() == "")
         {
             this.workItem = "工程量提交 ";
             this.workUrl  = "SubmitWorkLoad.aspx";
         }
         else if (JudgeName(userName, projectData["PNAME"].ToString(), projectData["PNUMBER"].ToString()) == 1 && projectData["DESIAPPROVALARRIVALDATE"].ToString() != "" && projectData["DESIAPPROVALARRIVALFILENUMBER"].ToString() != "" && projectData["SECONDCOMMISSIONDATE"].ToString() == "")
         {
             this.workItem = "提交二次委托 ";
             this.workUrl  = "ShowSecComFile.aspx";
         }
         else if (JudgeName(userName, projectData["PNAME"].ToString(), projectData["PNUMBER"].ToString()) == 1 && projectData["WHITEGRAPHCHECKDATE_R"].ToString() != "" && projectData["BLUEGRAPHDOCUMENT_R"].ToString() == "")
         {
             this.workItem = "上传蓝图 ";
             this.workUrl  = "SubmitBlueGraph.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "8" && Organization == "综合室")//综合室图纸管理人
     {
         if (projectData["BLUEGRAPHDOCUMENT_R"].ToString() != "" && projectData["BLUEGRAPHARRIVALDATE"].ToString() == "")
         {
             this.workItem = "下发蓝图,记录时间";
             this.workUrl  = "BlueGraphArrival.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else
     {
         this.workItem = "等待中";
     }
     return(this);
 }
Example #58
0
 public CTaskList getSingleTask_bdtz(System.Data.DataRow projectData)
 {
     if (projectData["BLUEGRAPHARRIVALDATE"].ToString() != "")
     {
         this.workItem = "结束";
     }
     else if (userlevel == "2" && Organization == "规划室")
     {
         if (projectData["YCZLSubmitDate"].ToString() == "" || projectData["CYZLSubmitDate"].ToString() == "" || projectData["DMZLDelegateDate"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = "ghs0_Datasubmit.aspx";
         }
         else if (projectData["SoluCompDate_P"].ToString() == "" || projectData["SoluCheckDate_P"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = "ghs4_Datasubmit.aspx";
         }
         else if (projectData["SOLUCOMPDATE_R"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = "ghs1_Datasubmit.aspx";
         }
         else if (projectData["SOLUCHECKDATE_R"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = "ghs2_Datasubmit.aspx";
         }
         else if (projectData["DESISUBMITDATE"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = "ghs3_Datasubmit.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "2" && Organization == "设计室")
     {
         if (projectData["INITIALDESISUBMITDATE_P"].ToString() == "" || projectData["BLUEGRAPHDOCUMENT_P"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = " DesignGraphDate.aspx";
         }
         else if (projectData["INITIALDESISUBMITDATE_R"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = " DesignFile.aspx";
         }
         else if (projectData["BLUEGRAPHDOCUMENT_R"].ToString() == "")
         {
             this.workItem = "进行中";
             this.workUrl  = " GraphFile.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else if (userlevel == "8" && Organization == "综合室")//综合室图纸管理人
     {
         if (projectData["BLUEGRAPHDOCUMENT_R"].ToString() != "" && projectData["BLUEGRAPHARRIVALDATE"].ToString() == "")
         {
             this.workItem = "下发蓝图,记录时间";
             this.workUrl  = "BlueGraphArrival.aspx";
         }
         else
         {
             this.workItem = "等待中";
         }
     }
     else
     {
         this.workItem = "等待中";
     }
     return(this);
 }
        public void CreatePODetailObject(System.Data.DataRow drow)
        {
            try
            {
                if (drow.Table.Columns.Contains(CON_FIELD_AMENDMENTNO))
                {
                    this.AmendmentNo = Convert.ToInt32(drow[CON_FIELD_AMENDMENTNO]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_CREATEDBY))
                {
                    this.CreatedBy = Convert.ToInt32(drow[CON_FIELD_CREATEDBY]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_CREATEDDATE))
                {
                    this.CreatedDate = Convert.ToDateTime(drow[CON_FIELD_CREATEDDATE]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_ITEMDESC))
                {
                    this.ItemDescription = Convert.ToString(drow[CON_FIELD_ITEMDESC]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_ITEMID))
                {
                    this.ItemID = Convert.ToInt32(drow[CON_FIELD_ITEMID]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_MODIFIEDBY))
                {
                    this.ModifiedBy = Convert.ToInt32(drow[CON_FIELD_MODIFIEDBY]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_MODIFIEDDATE))
                {
                    this.ModifiedDate = Convert.ToDateTime(drow[CON_FIELD_MODIFIEDDATE]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_PONUMBER))
                {
                    this.PONumber = Convert.ToString(drow[CON_FIELD_PONUMBER]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_POUOMID))
                {
                    this.PurchaseUOMID = Convert.ToInt32(drow[CON_FIELD_POUOMID]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_POUOM))
                {
                    this.PurchaseUOM = Convert.ToString(drow[CON_FIELD_POUOM]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_TAXGROUPCODE))
                {
                    this.TaxGroupCode = Convert.ToString(drow[CON_FIELD_TAXGROUPCODE]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_UNITPRICE))
                {
                    this.UnitPrice = Convert.ToDecimal(drow[CON_FIELD_UNITPRICE]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_UNITQTY))
                {
                    this.UnitQty = Convert.ToDecimal(drow[CON_FIELD_UNITQTY]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_ITEMCODE))
                {
                    this.ItemCode = Convert.ToString(drow[CON_FIELD_ITEMCODE]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_PUF))
                {
                    this.PUF = Convert.ToDecimal(drow[CON_FIELD_PUF]);
                }

                if (drow.Table.Columns.Contains(CON_FIELD_MOQ))
                {
                    this.MOQ = Convert.ToDecimal(drow[CON_FIELD_MOQ]);
                }
                if (drow.Table.Columns.Contains("IsInclusiveofTax"))
                {
                    this.IsInclusive = Convert.ToBoolean(drow["IsInclusiveofTax"]);
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Example #60
0
 /// <summary>
 ///  This method provides access to the values in each of the columns in a given row.
 ///  This method makes casts unnecessary when accessing columns.
 ///  Additionally, Field supports nullable types and maps automatically between DBNull and
 ///  Nullable when the generic type is nullable.
 /// </summary>
 /// <param name="row">
 ///   The input DataRow
 /// </param>
 /// <param name="column">
 ///   The input DataColumn specificy which row value to retrieve.
 /// </param>
 /// <returns>
 ///   The DataRow value for the column specified.
 /// </returns>
 public static T Field <T>(this DataRow row, DataColumn column)
 {
     DataSetUtil.CheckArgumentNull(row, "row");
     return(UnboxT <T> .Unbox(row[column]));
 }