public Yarn_Head_Count Get_Yarn_Head_Count_By_Id(int ID) { Yarn_Head_Count _Yarn_Head_Count = new Yarn_Head_Count(); DataTable dt = Yarn_Head_Count_DA.Get_Yarn_Head_Count_By_Id(ID); foreach (DataRow row in dt.Rows) { _Yarn_Head_Count.ID = ID; _Yarn_Head_Count.Head_Count = int.Parse(row["Head_Count"].ToString()); } return _Yarn_Head_Count; }
public string Insert(int Head_Count) { Yarn_Head_Count _Yarn_Head_Count = new Yarn_Head_Count(); _Yarn_Head_Count.Head_Count = Head_Count; _Yarn_Head_Count.CreatedBy = Session["User"].ToString(); return Yarn_Head_Count_DA.Insert(_Yarn_Head_Count); }
public string Update(int ID, int Head_Count) { Yarn_Head_Count _Yarn_Head_Count = new Yarn_Head_Count(); _Yarn_Head_Count.ID = ID; _Yarn_Head_Count.Head_Count = Head_Count; _Yarn_Head_Count.UpdatedBy = Session["User"].ToString(); if (_Yarn_Head_Count.UpdatedBy.ToString().ToUpper() == ("Mr. Asif").ToString().ToUpper() || _Yarn_Head_Count.UpdatedBy.ToString().ToUpper() == ("Saud Piracha").ToString().ToUpper()) { return Yarn_Head_Count_DA.Update(_Yarn_Head_Count); } else { return "-1"; } }
public static string Insert(Yarn_Head_Count _Yarn_Head_Count) { DbCommand command = Catalog_Access.CreateCommand(); command.CommandText = "sp_insert_Yarn_Head_Count"; DbParameter param; param = command.CreateParameter(); param.ParameterName = "@Head_Count"; param.Value = _Yarn_Head_Count.Head_Count; param.DbType = DbType.Int32; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@CreatedBy"; param.Value = _Yarn_Head_Count.CreatedBy; param.DbType = DbType.String; command.Parameters.Add(param); param = command.CreateParameter(); param.ParameterName = "@Return"; param.DbType = DbType.String; param.Size = 2; param.Direction = ParameterDirection.Output; command.Parameters.Add(param); Catalog_Access.ExecuteNonQuery(command); string Return = command.Parameters["@Return"].Value.ToString(); return Return; }