Esempio n. 1
0
        public string ProductGroup(FormCollection collection)
        {
            // TODO: Add insert logic here
            string effFromdate = collection["Effective_From"].ToString();
            string effTodate   = collection["Effective_To"].ToString();

            if (!string.IsNullOrEmpty(effFromdate))
            {
                effFromdate = effFromdate.Split('/')[2] + "-" + effFromdate.Split('/')[1] + "-" + effFromdate.Split('/')[0];
                // effFrom = Convert.ToDateTime(collection["EffectiveFrom"].ToString()).ToString("yyyy-MM-dd");
            }
            if (!string.IsNullOrEmpty(effTodate))
            {
                effTodate = effTodate.Split('/')[2] + "-" + effTodate.Split('/')[1] + "-" + effTodate.Split('/')[0];
                // effTo = Convert.ToDateTime(collection["EffectiveTo"].ToString()).ToString("yyyy-MM-dd");
            }

            try
            {
                DataControl.SPData objData = new DataControl.SPData();
                string             result  = "";
                result = objData.InsertProductGroup("sp_sdInsertProductGroup", objCurInfo.GetCompanyCode(), collection["Product_Group"].ToString(),
                                                    effFromdate, effTodate, collection["Status"].ToString(), collection["Mode"].ToString(),
                                                    collection["Product_Group_Code"].ToString());

                return(result);
            }
            catch (Exception ex)
            {
                ErrorLog.LogError(ex, "ProductGroup()");
                return("");
            }
        }