예제 #1
0
 public static bool StockCreate(Dictionary <string, object> data,
                                out string result,
                                out int productid,
                                out decimal quantity,
                                out UnitType unit,
                                out string comment)
 {
     result    = string.Empty;
     productid = Convert.ToInt32(data["productid"]);
     quantity  = Convert.ToDecimal(data["quantity"]);
     unit      = UnitType.adet;
     comment   = data["comment"].ToString();
     if (!Valid.ID(productid))
     {
         result = "{\"RESULT\":6}";
         return(false);
     }
     if (!Valid.Quantity(quantity))
     {
         result = "{\"RESULT\":10}";
         return(false);
     }
     if (!Valid.UnitTypeVal(Convert.ToInt16(data["unit"]), out unit))
     {
         result = "{\"RESULT\":11}";
         return(false);
     }
     return(true);
 }
예제 #2
0
 public static bool ProductGetById(Dictionary <string, object> data,
                                   out string result,
                                   out int productid)
 {
     result    = string.Empty;
     productid = Convert.ToInt32(data["productid"]);
     if (!Valid.ID(productid))
     {
         result = "{\"RESULT\":6}";
         return(false);
     }
     return(true);
 }
예제 #3
0
 public static bool StockDelete(Dictionary <string, object> data,
                                out string result,
                                out int stockid)
 {
     result  = string.Empty;
     stockid = Convert.ToInt32(data["stockid"]);
     if (!Valid.ID(stockid))
     {
         result = "{\"RESULT\":9}";
         return(false);
     }
     return(true);
 }
예제 #4
0
 public static bool StockReport(Dictionary <string, object> data,
                                out string result,
                                out int productid,
                                out string dummydata)
 {
     result    = string.Empty;
     productid = Convert.ToInt32(data["productid"]);
     dummydata = string.Empty;
     if (!Valid.ID(productid))
     {
         result = "{\"RESULT\":6}";
         return(false);
     }
     return(true);
 }
예제 #5
0
        public static bool ProductCreate(Dictionary <string, object> data,
                                         out string result,
                                         out string name,
                                         out string comment)
        {
            result  = string.Empty;
            name    = data["name"].ToString();
            comment = data["comment"].ToString();

            if (!Valid.Name(name))
            {
                result = "{\"RESULT\":8}";
                return(false);
            }
            return(true);
        }
예제 #6
0
 public static bool ProductGetAll(Dictionary <string, object> data,
                                  out string result,
                                  out FilterType filterType,
                                  out string filter,
                                  out int pageIndex,
                                  out int pageRowCount)
 {
     filterType = datatype.FilterType.List;
     if (!getAll(data, out result, out filter, out pageIndex, out pageRowCount))
     {
         return(false);
     }
     if (!Valid.FilterType(Convert.ToInt16(data["filterType"]), out filterType))
     {
         result = "{\"RESULT\":-1}";
         return(false);
     }
     return(true);
 }
예제 #7
0
 public static bool ProductModify(Dictionary <string, object> data,
                                  out string result,
                                  out int productid,
                                  out string name,
                                  out string comment)
 {
     result    = string.Empty;
     productid = Convert.ToInt32(data["productid"]);
     name      = data["name"].ToString();
     comment   = data["comment"].ToString();
     if (!Valid.ID(productid))
     {
         result = "{\"RESULT\":6}";
         return(false);
     }
     if (!Valid.Name(name))
     {
         result = "{\"RESULT\":8}";
         return(false);
     }
     return(true);
 }