public static void SaveCycleProductIds(string selectedIds, string Object, string SessionID) { iCycleCountClient CycleClient = new iCycleCountClient(); try { CustomProfile profile = CustomProfile.GetProfile(); CycleCountTemp cycletemp = new CycleCountTemp(); cycletemp.Object = Object.ToString(); cycletemp.SessionID = SessionID.ToString(); cycletemp.CreatedBy = profile.Personal.UserID; cycletemp.CreationDate = DateTime.Now; string ids = selectedIds.ToString(); string[] words = ids.Split(','); for (int i = 0; i < words.Length; i++) { // long ProductID = long.Parse(words[i]); cycletemp.ReferenceID = long.Parse(words[i]); CycleClient.SaveCycleCounttemp(cycletemp, profile.DBConnection._constr); } } catch (Exception ex) { //Login.Profile.ErrorHandling(ex, this, "CycleSkuSearch", "SaveCycleProductIds"); } finally { CycleClient.Close(); } }
public long SaveCycleCounttemp(CycleCountTemp CycleTemp, string[] conn) { try { BISPL_CRMDBEntities db = new BISPL_CRMDBEntities(svr.GetEntityConnection(conn)); db.CycleCountTemps.AddObject(CycleTemp); db.SaveChanges(); return(CycleTemp.ID); } catch { return(0); } }