public void Saveitemsort(DepoItems obj) { _cnn.Open(); var ins = new SqlCommand("INSERT INTO [dbo].[grade_per]([tarikh],[faz],[shift],[per_id],[item_id],[gradea],[ahan],[khlabeh],[kharegi],[noglaze],[pin],[khglaze],[kafsefid],[deformation],[tarak] " + ",[dorangi],[sarsozani],[oftadegi],[payeh],[khbadaneh],[tarpayeh],[labpar],[rizesh],[hobab],[rageh],[khash],[tardasteh],[test],[shagh],[color],[kamrangi],[abrbad]) " + " VALUES" + "('" + obj.Tarikh + "'," + obj.Faz + "," + obj.Shift + ",'" + obj.PerId + "'," + obj.ItemId + "," + obj.Gradea + "," + obj.Ahan + "," + obj.Khlabeh + "," + obj.Kharegi + "," + obj.Noglaze + "" + "," + obj.Pin + "," + obj.Khglaze + "," + obj.Kafsefid + "," + obj.Deformation + "," + obj.Tarak + "," + obj.Dorangi + "," + obj.Sarsozani + "," + obj.Oftadegi + "" + "," + obj.Payeh + "," + obj.Khbadaneh + "," + obj.Tarpayeh + "," + obj.Labpar + "," + obj.Rizesh + "," + obj.Hobab + "," + obj.Rageh + "" + "," + obj.Khash + "," + obj.Tardasteh + "," + Convert.ToInt32(obj.Test) + "," + obj.Shagh + "," + obj.Color + "," + obj.Kamrangi + "," + obj.Abrbad + ")", _cnn); ins.ExecuteNonQuery(); _cnn.Close(); }
public void UpdateSortItem(DepoItems obj) { _cnn.Open(); var up = new SqlCommand("UPDATE [dbo].[grade_per] " + " SET [shift] =" + obj.Shift + " ,[per_id] =" + obj.PerId + " ,[item_id] =" + obj.ItemId + " ,[gradea] =" + obj.Gradea + " ,[ahan] =" + obj.Ahan + ",[khlabeh] =" + obj.Khlabeh + " ," + " [kharegi] =" + obj.Kharegi + " ,[noglaze] =" + obj.Noglaze + ",[pin] = " + obj.Pin + ",[khglaze] = " + obj.Khglaze + ",[kafsefid] = " + obj.Kafsefid + " ,[deformation] = " + obj.Deformation + ",[tarak] =" + obj.Tarak + " ," + " [dorangi] =" + obj.Dorangi + ",[sarsozani] =" + obj.Sarsozani + ",[oftadegi] =" + obj.Oftadegi + " ,[payeh] =" + obj.Payeh + " ,[khbadaneh] =" + obj.Khbadaneh + "" + " ,[tarpayeh] =" + obj.Tarpayeh + " ,[labpar] =" + obj.Labpar + " ,[rizesh] = " + obj.Rizesh + ",[hobab] =" + obj.Hobab + " ,[rageh] =" + obj.Rageh + " ,[khash] = " + obj.Khash + "," + " [tardasteh] =" + obj.Tardasteh + " ,[test] =" + Convert.ToInt32(obj.Test) + ",[shagh] =" + obj.Shagh + " ,[color] =" + obj.Color + " ,[kamrangi] =" + obj.Kamrangi + " ,[abrbad] =" + obj.Abrbad + " " + " WHERE id = " + obj.Id + " " + " ", _cnn); up.ExecuteNonQuery(); _cnn.Close(); }